Colors
Every color role in the theme, with the token and the utility that reach it
Colors are semantic: a component asks for a role, never for a value. Every role that carries
content has a -foreground partner readable on it, and the two move together when a theme
changes one.
Each role below is shown in both shipped themes at once, drawn from the tokens themselves. A variant is drawn inside the layer it appears on, because that is where it appears: a hover replaces the surface under it, a foreground is content on that surface, and a tint is stacked on whatever it tints. The name on a layer is written in the foreground it pairs with, so the label is the legibility test.
Accent
The primary action, used sparingly: overuse costs it its meaning. A -soft role is the same hue
at low opacity, so what shows through it belongs to the layer underneath.
Default
The neutral control: every button, chip and toggle that carries no status.
Success
Warning
Danger
Text
Text roles are drawn on the page itself. --muted is secondary text, not disabled text: a
disabled control carries --disabled-opacity.
Backgrounds
The deeper levels exist for regions inside regions, which is how they are drawn here.
Surfaces
A surface is a container that does not float: a card, a panel, a table header. Its levels nest the same way the backgrounds do.
On Surface
Controls that sit on a surface rather than on the page, so they stay distinct from it.
Overlays
A floating container — popover, menu, tooltip — and the scrim behind a modal one. --backdrop is
translucent, so what you see through it is the page underneath.
Form Fields
A field carries its own roles, because it reads as an input whatever surface holds it. The border
belongs to the field, so it is drawn inside it — and --field-border is transparent in both
themes: the field is told apart by its background, and the outline appears on hover and focus.
Borders and Separators
A border outlines a thing; a separator divides two. Each has two quieter levels.
Focus and Chrome
The thumb rides the track, so it is drawn on it.
Primitives
Two values are absolute rather than semantic — --black and --white. They do not change with
the theme, which is the only reason to reach for one.
Using a Role
Every role is a Tailwind utility and a custom property at once. Reach for the utility in markup and the property in CSS of your own.
<div className="bg-surface text-surface-foreground border-separator border">
<span className="text-muted">Secondary</span>
</div>.my-panel {
background-color: var(--surface);
color: var(--surface-foreground);
}Take the pair, not one half of it: bg-surface with text-foreground survives the default theme
and breaks in the next one.
Changing a Role
Override the property and every component that asks for the role follows — the mechanics, the levels at which an override lands and the dark-theme pair are in Theming. To try values against a whole page first, use the Theme Builder, which exports the CSS it shows.