Every token has a tier, a category and a name, and either a raw value or references. The rules below are enforced on every write, in the workbench and on the API alike.
Tiers
| Tier | Holds | Light ref | Dark ref | Component |
|---|---|---|---|---|
DESIGN |
a raw value | no | no | no |
SEMANTIC |
nothing | a design token | a design token | no |
COMPONENT |
nothing | a semantic or design token | no | required |
A reference stays inside its category: a semantic colour points at a design colour, never at a radius. A typography reference also stays inside its kind, so a font-size slot points at a size.* token, never at a family.*.
Categories
| Category | Holds |
|---|---|
color |
a colour (oklch(), hex, rgb()); the three tiers resolve to one value per theme |
spacing |
a length on the spacing scale |
radius |
a corner radius |
typography |
a font family, size, weight or line height, told apart by the name prefix |
shadow |
a box shadow, one or more layers |
zIndex |
a stacking order |
border |
a border width |
gradient |
a gradient direction in whole degrees (135deg); a gradient itself is a group: the direction, colour semantics <name>-from, optional -via and -to, and a gradient semantic <name> whose variable is the composed linear-gradient(...) |
blur |
a blur radius for glass surfaces (24px); glass itself is a group of semantics: glass, glass-strong, glass-border (colours) and glass-blur |
Names
A name matches [a-zA-Z0-9][a-zA-Z0-9._-]* and is at most 100 characters; a raw value is at most 500 characters and must be a plain CSS value (no url(), no expressions). Within a project, a name is unique per tier, category and component.
Typography names carry their kind as a prefix: family.* is a font family, weight.* a weight, leading.* a line height, anything else a size. Component slots name the kind CSS-style instead: font-family, font-weight, font-size.
Semantic and component tokens share one CSS namespace. A semantic card-foreground becomes --card-foreground; a component token foreground under card would become the same variable, so it is refused. Dots in a name become hyphens in the variable.
Components
A component token names one of these components. The slots each one reads are on Components and slots.
accordion, alert, avatar, badge, breadcrumb, bubble, button, card, checkbox, cta-band, dialog, dropdown-menu, empty, hero, input, item, kbd, menubar, popover, progress, radio-group, select, separator, sheet, sidebar, skeleton, slider, spinner, switch, table, tabs, textarea, toast, toggle, tooltip