Imagine your brand blue appears in 400 places across a website and two mobile apps. Then the brand team changes the shade. Someone must find and fix every single spot. That is slow and risky. Design tokens solve this problem. This guide explains what they are, how they work, and how to use them well.
What Are Design Tokens?
Design tokens are named values that store the small design decisions of a product. Instead of writing a color code like #1A73E8 everywhere, you give it a name such as color-primary and use that name. The same idea applies to font sizes, spacing, border radius, shadows, and more. Change the value once, and every place that uses the name updates at once. The term was popularized by Salesforce designers Jina Anne and Jon Levine, who used it in the Lightning Design System around 2014.
Why Design Tokens Matter
Tokens act as a single source of truth. Designers and developers read from the same list, so a button looks the same in Figma and in code. They also make big changes easy. A rebrand, a dark theme, or a new product line can be handled by updating token values rather than redoing every screen. Tokens save time, reduce errors, and keep large products consistent. They are also the base layer of a strong design system, which depends on shared rules that every team can follow.
Types of Design Tokens
Most teams group tokens by what they describe.
- Color tokens: Brand colors, text colors, background colors, and status colors such as success or error.
- Typography tokens: Font families, sizes, weights, and line heights.
- Spacing tokens: Gaps, padding, and margins, often on a scale such as 4, 8, 16, and 24 pixels.
- Sizing tokens: Widths and heights for icons, buttons, and inputs.
- Border and radius tokens: Line thickness and corner roundness.
- Shadow tokens: Depth levels for cards, menus, and pop-ups.
- Motion tokens: Animation speed and easing curves.
- Breakpoint tokens: Screen widths where layouts change.
Token Levels: Global, Alias, and Component
Tokens often work in layers, and this structure keeps them flexible.
Global tokens hold raw values. For example, blue-500 equals a specific blue. They describe what the value is, not how it is used.
Alias tokens, also called semantic tokens, give meaning to those values. For example, color-action-primary points to blue-500. They describe the purpose.
Component tokens apply to one part of the interface. For example, button-background points to color-action-primary. They make it easy to adjust one component without touching others.
This chain lets you change a theme by remapping aliases, while the raw values stay the same.
A Simple Example
Say a brand uses a blue for main buttons. The team creates a global token called blue-500 with a fixed color value. They then create an alias token called color-action-primary that points to blue-500. The button component uses color-action-primary for its background. Later, the brand picks a deeper blue. The team updates blue-500 once. Every button, link, and highlight that relies on it changes right away. For dark mode, they point color-action-primary to a lighter blue, and the whole interface adapts.
Real-World Examples
Salesforce Lightning. Tokens manage color, spacing, and type across a huge product suite.
Google Material Design. Material uses tokens for color roles, shape, and typography to power theming.
Atlassian Design System. Tokens support light and dark modes across tools like Jira and Confluence.
Shopify Polaris. Tokens keep the admin interface consistent for merchants and app builders.
Adobe Spectrum. Tokens help one design language work across many apps and platforms.
You can see more of how teams structure shared rules in these design system examples.
Design Tokens vs CSS Variables vs Style Guides
These terms are often mixed up. A style guide is a document that lists brand rules. Tokens turn those rules into data that tools can read. CSS variables are one way to use tokens in code. Tokens themselves are platform-neutral, usually stored in a format like JSON. A build tool, such as Style Dictionary, can convert that file into CSS variables for the web, XML for Android, and Swift for iOS. This lets one source feed every platform.
Pros and Cons of Design Tokens
Pros:
- Keeps design and code in sync.
- Makes rebrands and theme changes fast.
- Supports dark mode and multi-brand products.
- Reduces repeated work and small mistakes.
- Gives teams a shared language.
Cons:
- Takes time to plan and set up.
- Poor naming can cause confusion.
- Too many tokens become hard to manage.
- Needs ongoing care as the product grows.
- Small teams with simple products may not need them.
How to Create Design Tokens
Start with an audit. Review your current designs and list every color, font size, and spacing value in use. You will likely find many near-duplicates. Next, trim the list to a clean set of values, such as a small color palette and a spacing scale. Then name each token with a clear pattern. Group them into global, alias, and component layers. Store them in a shared file, then use a tool to turn them into code for each platform. Finally, connect the tokens to your design tool, so designers use the same values that developers do. If you want expert help, a team offering design systems and component library services can set up the full structure.
Design Tokens Best Practices
- Name by purpose, not by value. Use color-text-danger instead of red-text, since the value may change.
- Use a clear naming pattern. A format like category-property-role-state keeps names easy to read.
- Keep layers simple. Two or three levels are enough for most teams.
- Limit your values. Use a small scale for spacing, type, and color to keep the product consistent.
- Document each token. Note what it is for and where to use it.
- Use one source of truth. Store tokens in one place and generate everything else from it.
- Plan for themes. Build alias tokens so light, dark, and brand themes can swap easily.
- Check accessibility. Make sure color pairs meet WCAG contrast ratios.
- Version your tokens. Track changes so teams know what updated and why.
- Review often. Remove unused tokens and merge duplicates.
- Work together. Designers, developers, and product owners should agree on names and rules. A strong UI design process makes this teamwork smoother.
Common Mistakes to Avoid
The most common mistake is creating too many tokens too soon. Teams end up with hundreds of names that no one remembers. Another is naming by appearance, such as blue-button, which breaks when the design changes. Some teams skip the semantic layer and use raw values everywhere, which removes much of the benefit. Others keep tokens in design files only, so developers never use them. Poor documentation also hurts, because people guess and create their own versions. Finally, many forget to test tokens across screen sizes and themes, which is where responsive design checks catch problems early.
Final Thoughts
Design tokens turn scattered style choices into a clear, shared system. They keep products consistent, speed up changes, and help design and development teams work as one. Start small with core colors, type, and spacing. Name tokens by purpose, keep your layers simple, and document everything. As your product grows, your tokens will grow with it, and every update will take minutes instead of days.