Skip to content

Customization Guide

Always try token overrides first. Reach for class overrides only when tokens cannot express the change you need.

Since v2026.08.04, the custom CSS you save in the banner editor is injected into all three consent shadow roots — one <style> tag each, always appended after Kookiok’s built-in CSS:

SurfaceShadow hostKey selectors
Consent banner#ag-consent-banner-host.ag-banner, .ag-btn, …
Privacy trigger (floating button)#ag-privacy-trigger.ag-trigger-btn
Preferences popup#ag-privacy-popup-host.ag-popup, .ag-popup-btn, …

Selectors only match inside their own shadow root, so banner rules cannot leak into the popup and vice versa. :host { } token overrides apply per shadow root — the trigger and popup read the same tokens (--btn-fill, --surface, --trigger-bg, …), so a single token block themes all three surfaces consistently.

Before v2026.08.04, custom CSS reached only the banner shadow root; .ag-trigger-btn / .ag-popup-* rules were silently inert. Existing stylesheets that already contain such rules become active — review yours after upgrading.

Is the property controlled by a token?
├── Yes → Override the token on :host { }
│ (e.g., --btn-fill, --radius, --surface)
└── No → Is it a layout or structural adjustment?
├── Yes → Class override (e.g., .ag-banner-inner { padding: 14px })
└── No → Is it a pseudo-element or animation?
├── Yes → Class override with ::before / ::after
└── No → Reconsider. You may be fighting the template.

Token overrides win in almost all brand-color and sizing scenarios. Class overrides are needed for:

  • Custom @keyframes animations on entry/exit
  • @media breakpoint adjustments
  • Structural changes like flex-direction, grid-template-columns
  • Pseudo-element content or decoration

All token overrides go on :host. This single rule propagates to every element that reads the token:

Token override pattern
:host {
/* Colors */
--surface: #0f172a;
--surface-text: #f8fafc;
--btn-fill: #6366f1;
--btn-text: #ffffff;
--btn-hover-fill: #4f46e5;
--accent: #818cf8;
/* Shape */
--radius: 12px;
/* Typography */
--font-family: "Inter Variable", system-ui, sans-serif;
--font-heading-size: 20px;
--font-body-size: 15px;
}

Class overrides — specificity cheat sheet

Section titled “Class overrides — specificity cheat sheet”

Inside the Shadow Root, specificity works exactly as in regular CSS. Use the minimal specificity that wins:

What you’re overridingMinimum specificityExample selector
An element defaultSingle class.ag-banner-inner
A token-driven valueSingle class (tokens have low specificity).ag-btn
A template ::before decorationClass + pseudo-element.ag-banner::before
An interactive stateClass + pseudo-class.ag-btn:hover

Avoid !important in custom CSS — it fights the compliance-enforced branding lock and may produce unpredictable results if Kookiok updates its own styles.

By default, the banner adopts its theme from the selected template (light or dark). If your site uses a CSS class or prefers-color-scheme to toggle dark mode, you can add a conditional override:

Respect system dark mode
@media (prefers-color-scheme: dark) {
:host {
--surface: #0f172a;
--surface-text: #f1f5f9;
--surface-overlay: rgba(0, 0, 0, 0.75);
}
}

Don't override branding

Any CSS targeting .ag-branding or its children is rejected server-side and blocked runtime. See Branding Policy.

Don't differentiate Accept vs Reject

Different colors, shadows, or sizes between Accept and Reject buttons violate EDPB 05/2020 §86. The compliance checker will flag this.

Don't hide Reject on mobile

Hiding the Reject button at any viewport width is a GDPR violation. Use flex-wrap: wrap to stack buttons on small screens instead.

Don't use @import in custom CSS

@import is stripped by the sanitizer. Load fonts on the host page using self-hosted @font-face rules.

Don't drop z-index on .ag-banner

The z-index 2147483647 keeps the banner above all site content. Reducing it can make the banner appear behind overlapping elements on your site.

Don't change overflow on .ag-banner-inner

Setting overflow: hidden will clip dropdown menus and the lang select dropdown.

Starter template — replace values with your brand
/* 1. Token overrides — adjust these to match your brand */
:host {
--btn-fill: #YOUR_BRAND;
--btn-text: #ffffff;
--btn-hover-fill: #YOUR_BRAND_HOVER;
--accent: #YOUR_BRAND;
--radius: 8px;
--font-family: "YourFont", system-ui, sans-serif;
}
/* 2. Class overrides — only if tokens aren't enough */
.ag-banner-inner {
padding: 18px;
}
/* 3. Responsive adjustments */
@media (max-width: 600px) {
.ag-banner-inner {
padding: 14px;
}
}