design token
A named design decision, such as a colour, font size or spacing value, stored as data so every platform can use the same value.
In more detail
Instead of typing #3b82f6 or 16px into many files, teams give the value a name such as color.action.bg and reference the name. Tokens are stored in JSON files and compiled into CSS, TypeScript, iOS and Android formats. Changing a token in one place changes it everywhere it is used.
Examples
In the browser: Components use semantic token names, and themes change what the tokens point to. That keeps colour choices in one place.A UI component package depends on a tokens package, so changing a token forces the components to rebuild.Related terms
- Design Tokens Community Group — The W3C community group that writes a shared JSON format for design tokens so design tools and code tools can exchange them.
- global token — A token that holds a literal value from the full palette, such as blue.500 = #3b82f6, with no meaning attached.
- semantic token — A token named for its purpose, such as color.action.bg or color.surface, that points at a global token.
- component token — A token scoped to one component, such as button.primary.bg, that usually points at a semantic token.
- Style Dictionary — An open-source build tool that reads design token files and generates code for each platform, such as CSS, TypeScript, Swift and Android resources.
- CSS custom property — A property you define yourself with a double-hyphen name, such as --brand: #0066cc, and read elsewhere with var(--brand).
- theming — Giving the same components different looks, such as light, dark or a different brand, by swapping the token values they use.
- design system — A shared set of design decisions, reusable components and rules that keeps every screen of a company's products looking and behaving the same way.
- monorepo — A single version-control repository that holds several related projects, such as a web app, an API and their shared libraries.
- task graph — A map of which build tasks depend on which others, used to decide what must run first and what can run at the same time.
- satisfies — An operator, value satisfies Type, that checks a value matches a type without changing the value's own, more precise inferred type.
- hex color — A colour written as # followed by hexadecimal digits for its red, green and blue amounts, such as #2563eb.
- RGB — A way of describing a colour by how much red, green and blue light to mix, each usually from 0 to 255.
Taught in
- Design Systems Architecture: Foundations, Layers & Taxonomy — Design Systems & Component Engineering
- Design Tokens: W3C Specs, Global, Semantic & Component Tokens — Design Systems & Component Engineering
- Token Transformation: Style Dictionary & Multi-Platform Outputs — Design Systems & Component Engineering
- Typography & Spatial Grids: Modular Scales & Fluid Typography — Design Systems & Component Engineering
- CSS Custom Properties & Dynamic Theming Architecture — Design Systems & Component Engineering
- CSS Custom Properties: Scoping, Fallbacks And Theming — Frontend Architecture & Web Platform
- Unified Build Pipelines: Caching & Dependency Graphs — Production Full-Stack Engineering
- The satisfies Operator: Safe Validation Without Widening — Production TypeScript