Naming Conventions
Naming Conventions
How tokens are named across the primitive and semantic layers.
Two Patterns
The token system uses two distinct naming patterns, one per layer:
| Layer | Pattern | Example |
|---|---|---|
| Primitive | --{category}-{name} | --colors-neutral-500 |
| Semantic | --{element}-{qualifier} | --surface-background |
Key Rules
- Never invent token names — use existing tokens from the design system source
- Never hardcode color/spacing values — breaks theming and consistency
- Use semantic tokens in components, not primitives
- Primitives only when defining new semantics — reference via
var()
Flat Token Alternative
In LLM-mediated workflows, a single-layer naming convention is also used:
--{component}-{part}-{state}
--button-bg-rest
--button-bg-hover
--input-border-focus
--input-height-smSee Flat Approach for when to use this pattern.