UnflowUI
Tokens

Semantic Tokens

Role-based token mappings for backgrounds, foregrounds, borders, and interactive states in light and dark modes.

Semantic tokens map functional roles to primitive colour values. Using semantic tokens instead of primitives means a single token change updates every element that uses that role — and dark mode is handled automatically.

Token structure

Semantic tokens are grouped into five categories:

bg — backgrounds

TokenRole
bg.baseDefault page/panel background
bg.subtleSlightly elevated surface (sidebars, cards)
bg.mutedReceded, secondary content areas
bg.emphasisHigh-contrast background (banners, emphasis panels)
bg.inverseInverted background (dark surface on light theme)

fg — foregrounds / text

TokenRole
fg.basePrimary text
fg.mutedSecondary, supporting text
fg.subtleTertiary, placeholder text
fg.onInverseText on top of an bg.inverse surface
fg.brandBrand-colored text
fg.accentAccent/highlight text (indigo by default)

border — borders

TokenRole
border.baseDefault border
border.mutedLighter border for subtle dividers
border.emphasisStronger border for focus/active states
border.brandBrand-colored border

interactive — interactive states

TokenRole
interactive.primaryPrimary action background
interactive.primaryHoverPrimary action hover background
interactive.primaryActivePrimary action active/pressed background
interactive.accentAccent action background
interactive.accentHoverAccent action hover
interactive.accentActiveAccent action active

surface — layered surfaces

TokenRole
surface.baseBase layer surface
surface.raisedElevated surface (modals, dropdowns)
surface.overlayTop-level overlay (tooltips, popovers)

Light / dark themes

The semantic token map is defined twice — once for light and once for dark. The correct values are applied via a [data-theme] CSS attribute or media query, depending on how your app's theme switcher works.

/* simplified example */
[data-theme='light'] {
  --bg-base: var(--color-white);
  --fg-base: var(--color-black);
}

[data-theme='dark'] {
  --bg-base: var(--color-grey-950);
  --fg-base: var(--color-grey-50);
}

Note: The semantic token values are currently being finalised. The structure above is the intended API; exact primitive mappings will be documented here as they are locked in.