Skip to content

Design Tokens Reference

Overriding tokens on :host { } is the preferred customization method — one override affects all elements that consume the token, and is less likely to break on template updates.

Declare token overrides on the :host pseudo-class. This sets values that cascade to all elements inside the Shadow Root:

Custom CSS — token overrides
:host {
--btn-fill: #6366f1;
--btn-text: #ffffff;
--radius: 8px;
--font-family: "Inter", system-ui, sans-serif;
}

Tokens marked theme-derived get their default value from the selected theme (light/dark). Tokens marked brand-derived get their value from your brand HSL color configured in BannerConfig. You can override either with explicit values.

Surface tokens control backgrounds and borders of the banner card and its nested cards.

--surface
surfaces color
Default
theme-derived
Derived from
theme, brandHSL
Used by
.ag-banner, .ag-overlay backdrop
Notes
purpose: Primary banner background
contrast: WCAG AA against --surface-text
--surface-elevated
surfaces color
Default
theme-derived
Derived from
--surface
Used by
.ag-bar-cats Settings Card
Notes
purpose: Slightly elevated surface for nested cards
--surface-sunken
surfaces color
Default
theme-derived
Derived from
--surface
Used by
.ag-detail-cat
Notes
purpose: Recessed surface for category cards
--surface-overlay
surfaces color
Default
rgba(15, 23, 42, 0.5)
Used by
.ag-overlay
Notes
purpose: Backdrop dimming; alpha typically 0.3-0.7
--surface-border
surfaces color
Default
theme-derived
Derived from
--surface
Used by
.ag-bar-cats, .ag-detail-cat, .ag-links
Notes
purpose: Subtle dividers between sections
--surface-text
surfaces color
Default
theme-derived
Derived from
--surface
Used by
.ag-banner, .ag-title
Notes
purpose: Primary body text
contrast: WCAG AA against --surface
--surface-text-muted
surfaces color
Default
theme-derived
Derived from
--surface-text
Used by
.ag-desc, .ag-bar-cats-label
Notes
purpose: Secondary text
--surface-text-subtle
surfaces color
Default
theme-derived
Derived from
--surface-text
Used by
.ag-links font color, .ag-branding text
Notes
purpose: Tertiary text
note: Branding text uses this token

Button tokens must be set equally for all three consent buttons (Reject, Accept, Accept selected) — use the base tokens on :host, not per-button class overrides.

--btn-fill
interactive color
Default
brand-derived
Derived from
brandHSL
Used by
.ag-btn background
Notes
purpose: Button background
compliance: Same for all 3 buttons
--btn-text
interactive color
Default
brand-derived
Derived from
--btn-fill
Used by
.ag-btn color
--btn-border
interactive color
Default
brand-derived
Derived from
--btn-fill
Used by
.ag-btn border
--btn-hover-fill
interactive color
Default
brand-derived
Derived from
--btn-fill
Used by
.ag-btn:hover

Accent tokens control focus rings, link colors, and toggle active states.

--accent
accent color
Default
hsl(var(--brand-h) 80% 55%)
Derived from
brandHSL
Used by
:focus-visible outline, .ag-link hover
Notes
purpose: Primary brand accent
--accent-hover
accent color
Default
darker accent
Derived from
--accent
Used by
.ag-link:hover
--accent-on-surface
accent color
Default
brand-derived
Derived from
--accent, --surface
Used by
.ag-link
Notes
purpose: Accent variant tuned for readability on --surface

Category tokens control the chip toggles and category cards in the settings and detail panels.

--toggle-active
categories color
Default
var(--accent)
Derived from
--accent
Used by
.ag-bar-cat.on, .ag-detail-toggle active
Notes
compliance: Must visually indicate ON state distinctly from OFF
--toggle-track
categories color
Default
theme-derived
Used by
.ag-bar-cat track, .ag-detail-toggle track
--category-bg
categories color
Default
theme-derived
Derived from
--surface
Used by
.ag-gpc-notice, .ag-detail-cat

The privacy trigger is the floating cookie button that re-opens the banner after consent. It has its own token scope.

--trigger-bg
trigger color
Default
var(--accent)
Derived from
--accent
Used by
Privacy Trigger floating button
--trigger-icon
trigger color
Default
contrast against --trigger-bg
Derived from
--trigger-bg
Used by
Privacy Trigger icon

Effect tokens control visual decoration: corner radius, drop shadow, backdrop blur, border, and entrance animation.

--radius
effects dimension
Default
12px
Used by
.ag-banner, .ag-btn, .ag-bar-cats, .ag-detail-cat
Notes
purpose: Corner roundness; 0 for sharp, 9999px for pill
--shadow
effects shadow
Default
recipe-derived
Derived from
recipe
Used by
.ag-banner box-shadow
--blur
effects dimension
Default
0px
Derived from
recipe
Used by
.ag-banner backdrop-filter (Glass template)
none
--border-style
effects string
Default
none
Derived from
recipe
Used by
.ag-banner border
recipe-derived
--animation
effects string
Default
recipe-derived
Derived from
recipe
Used by
.ag-banner mount animation

Typography tokens control font family and size scale across the banner.

system-ui, sans-serif
--font-family
typography string
Default
system-ui, sans-serif
Used by
.ag-banner
Notes
note: Customer fonts must be self-hosted (GDPR — no Google Fonts CDN)
--font-heading-size
typography dimension
Default
18px
Used by
.ag-title
--font-body-size
typography dimension
Default
14px
Used by
.ag-desc
--font-button-size
typography dimension
Default
14px
Used by
.ag-btn