All UX laws

Token Layering

Name colours and sizes by their role, not their value, so one change updates a whole theme.

Primitive tokens hold raw values; semantic tokens map them to roles. Themes swap semantics.

By Rohit Sonawane, product designer · Last reviewed 16 November 2026

What are design tokens?

Design tokens are named values for design decisions, such as colours, spacing and font sizes, stored once and used in both design files and code. Token layering adds tiers: primitive tokens hold raw values, and semantic tokens map them to roles like 'primary' or 'error'.

Token Layering, side by side

Components reference a role, not a hex. Then a rebrand or dark theme is one remapping, not a hundred edits.

How do you apply Token Layering?

Components reference --color-primary, never #3B82F6. Brand theme swaps the mapping.

How to apply Token Layering, step by step

  1. Define primitive tokens for your raw palette, spacing and type sizes.
  2. Define semantic tokens for roles, such as primary, surface and error, pointing to primitives.
  3. Make components use only semantic tokens.
  4. Create themes by remapping semantic tokens, not by editing components.

What does Token Layering look like in a real product?

Why components reference --color-primary, not #3B82F6

Split tokens into two layers: primitives hold raw values (blue-500 = #3B82F6) and semantic tokens map them to roles (--color-primary points at blue-500). Components only ever reference the semantic role. Now a rebrand, a dark theme, or a white-label client is one remapping at the semantic layer, not a find-and-replace of a hex value across hundreds of files. This is how a design system ships multiple themes from a single component set.

What are common mistakes with Token Layering?

  • Hard-coding raw hex values in components, so any theme change means editing every component by hand.
  • Collapsing the two layers, so semantic names carry raw values directly and a theme swap has nowhere clean to happen.
  • Naming a semantic token after its colour (--blue-button) instead of its role (--color-primary), which breaks the moment the brand colour changes.

When does Token Layering not apply?

The layering earns its keep when a system needs to theme, rebrand, or scale across products. A tiny one-off site with a single fixed palette can reference primitives directly without the ceremony. Add the semantic layer when a second theme, a rebrand, or a white-label requirement actually appears, not speculatively before there is anything to swap.

How do you know you applied Token Layering well?

You can switch to a new theme or brand colour by changing token mappings alone, without touching any component.

Token Layering: frequently asked questions

What is the difference between primitive and semantic tokens?

A primitive token names a raw value, such as blue-500. A semantic token names a role, such as color-primary, and points to a primitive. Components use semantic tokens, so changing a theme only changes the mapping.

Why should components not use raw colour values?

Because a raw value like #3B82F6 has no meaning. If the brand colour changes or you add a dark theme, you would have to find and change every use by hand.

Is there a standard format for design tokens?

The W3C Design Tokens Community Group is working on a shared format, and tools like Figma variables and Style Dictionary support tokens in design and code.

Practise it on a real challenge

Design Tokens — one app, three brands

Your product ships under 3 brands. Each has its own color, type, radius.

Put Token Layering into practice

  • UI Design System Manager — Track components, tokens, and brand in one source of truth.

Related reading

  • Nielsen's 10 usability heuristics, with a real example of each

More UX laws

  • Visual hierarchy
  • 8-pt Spacing Scale
  • Von Restorff Effect
  • Modular Type Scale
  • Law of Proximity
  • 60-30-10 Rule
UX QuestUX Laws and PrinciplesUI UX PracticeUX Design Challenge GeneratorNotion TemplatesBlogPricingAboutContactPrivacy PolicyTerms of ServiceRefund PolicySitemapChangelogPopular UX laws:60-30-10 RuleDesign every stateStatistical PowerFunnel TriageAccessible contrastDensity Matches ContextHick's LawFitts's LawAll UX laws