Design Tokens
Named values that carry design decisions, so a change happens once rather than in every consuming file.
Definition
A design token is a named entity storing a design decision: a colour, a spacing step, a font size, a duration. Tokens are consumed by designs and by code, which is what keeps the two in sync.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
On this plate
Reach for this when
- Starting a design system.
- Adding a theme or a second brand.
- Consolidating values that have grown organically.
Common mistakes
- Components referencing primitives.
- Names describing appearance.
- Too many tokens.
- Tokens defined in design but not in code, or the reverse.
Three layers, and why the middle one matters
| Layer | Example | Who uses it |
|---|---|---|
| Primitive | blue-600, space-4, size-16 | Only the semantic layer. Never a component. |
| Semantic | action-primary, surface-raised, text-secondary | Components and designers. This is the API. |
| Component | button-primary-background | One component. Optional, and only where a component genuinely needs its own decision. |
Naming that survives
- Name by role, not by appearance. text-secondary survives a palette change; text-grey does not.
- Use a consistent structure, such as category, role, variant, state.
- Do not encode the value in the name. space-16 breaks when the scale changes.
- Keep the set small enough that people can hold it in mind. A hundred colour tokens will be used inconsistently.
- Document what each token is for, with an example of the wrong choice.
One source, three outputs
# source of truth: tokens/semantic.json (DTCG shape)
{
"action": {
"primary": {
"$type": "color",
"$value": "{palette.blue.600}",
"$description": "Primary action fill. Not for links."
}
}
}
# generated: web/tokens.css
:root { --action-primary: #2563eb; }
# generated: ios/Tokens.swift
static let actionPrimary = Color(hex: 0x2563EB)
# generated: design tool variables, from the same pipelineTokens authored once and generated into every consuming format. Hand-copying any one of these outputs is where drift starts, and preventing that is the reason the layer exists.
Keeping the set usable
Do
- Define the token set before the component library, since components built against ad-hoc values have to be rewritten.
- Give every semantic token one job, and state in its description what the wrong use would be.
- Generate every consuming format from the same source, including the design tool's variables.
- Delete a token when its last consumer goes. Anything left in the list will be adopted by the next person reading it.
Do not
- Do not add a token for a value used once. A one-off belongs in the component until it recurs.
- Do not encode a theme in a semantic name. A token called text-primary-dark defeats the remap that makes theming work.
- Do not let two semantic tokens resolve to the same primitive without a reason you can state. Either they mean different things or one of them should go.
- Do not publish primitives as part of the API. Consumers will reference them, and the layer stops being replaceable.
What the three layers buy you
In practice
- i.
Rebranding without touching components
Multi-brand productsA product supporting several brands changes only the semantic token mapping per brand. Component code is untouched, which is what makes multi-brand maintainable at scale.
Local chart
SYS·001 · Region VI · Grid D4
This entry and the entries it is stated to connect with. Each line is labelled with what the connection means.
Sources
Where a source establishes something narrower than the popular reading of it, the note says so.
- [1]
Design Tokens Community Group, W3C Community Group
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Principles behind this
The reasoning this solution is an application of.
- Consistency and StandardsHEUR·004 · Heuristic
Relied on by
Entries that assume this is already in place.
- ThemingSYS·008 · Design system
Theming is token remapping. Without a semantic token layer there is nothing to remap.
Often used with
These usually appear in the same screen or the same decision.
- FigmaTOOL·001 · Tool
- Figma Dev ModeTOOL·042 · Tool
- PenpotTOOL·003 · Tool
- SketchTOOL·002 · Tool
- Style DictionaryTOOL·040 · Tool
- SupernovaTOOL·039 · Tool
- zeroheightTOOL·038 · Tool
Practical example
A worked decision where this was the deciding factor.
- Choosing a Density for an Analytics DashboardCASE·004 · Case study
- Migrating Product Teams onto a Design SystemCASE·003 · Case study
Short definition
The one-paragraph version, for when that is all you need.
- Design SystemTERM·084 · Term
- Design TokenTERM·071 · Term
- Semantic ColorTERM·066 · Term
- Single Source of TruthTERM·087 · Term
- ThemingTERM·088 · Term
Related concept
Connected closely enough to change how you apply this.
- Design System to DocumentationAI·007 · AI workflow
- Component Anatomy, States and VariantsSYS·009 · Design system
- Component API DesignSYS·002 · Design system
- Design and Code ParitySYS·010 · Design system
- Design System AuditsSYS·011 · Design system
- Design System DocumentationSYS·003 · Design system
- Design System GovernanceSYS·004 · Design system
- Brand Color in InterfacesFND·024 · UI foundation
- Color SystemsFND·026 · UI foundation
- Color Theory for InterfacesFND·019 · UI foundation
- Dark ModeFND·027 · UI foundation
- ElevationFND·048 · UI foundation
- Font SelectionFND·030 · UI foundation
- IconographyFND·050 · UI foundation
- LightnessFND·022 · UI foundation
- NeutralsFND·025 · UI foundation
- ProportionFND·013 · UI foundation
- RepetitionFND·010 · UI foundation
- RhythmFND·017 · UI foundation
- Semantic ColorFND·023 · UI foundation
- ShapeFND·046 · UI foundation
- SimilarityFND·005 · UI foundation
- Spacing SystemsFND·042 · UI foundation
- Type ScaleFND·031 · UI foundation
- Typographic HierarchyFND·032 · UI foundation
- Variable FontsFND·037 · UI foundation
- Visual StatesFND·053 · UI foundation
- Design HandoffFLOW·002 · Workflow