Skip to content
Now accepting Q2 projects — limited slots available. Get started →
Design · Updated Apr 30, 2026

What is Design Tokens?

Design tokens are named values that store visual design decisions like color, spacing, and typography for consistent multi-platform use.

What is a Design Token?

A design token is a named, platform-agnostic key-value pair that captures a single design decision—like color.brand.primary: #1A73E8 or spacing.md: 16px. The concept was introduced by Salesforce's Lightning Design System around 2014 and formalized by the W3C Design Tokens Community Group, whose draft spec (DTCG format) reached second editor's draft in 2023. Tokens sit between raw values and component code: designers define them in tools like Figma (via Variables, shipped in 2023), and build tools like Style Dictionary or Tokens Studio translate them into CSS custom properties, Swift constants, XML resources, or any other platform output. The result is a single source of truth that keeps a button's border-radius identical whether it renders in a React web app, an iOS native view, or an Android Compose layout. We've shipped token-driven design systems on 50+ projects, and the pattern consistently cuts design-to-dev handoff friction by eliminating magic numbers.

How it works

At its core, a design token system has three layers:

  1. Token definition — A JSON or YAML file stores tokens in a nested structure:
{
  "color": {
    "brand": {
      "primary": { "$value": "#1A73E8", "$type": "color" },
      "secondary": { "$value": "#E8710A", "$type": "color" }
    }
  },
  "spacing": {
    "sm": { "$value": "8px", "$type": "dimension" },
    "md": { "$value": "16px", "$type": "dimension" }
  }
}

The $value and $type keys follow the DTCG spec format.

  1. Transformation — A build tool reads the definition and outputs platform-specific files. Style Dictionary (v4, released 2024) is the most common. It takes token JSON and generates:

    • CSS: --color-brand-primary: #1A73E8;
    • iOS Swift: static let colorBrandPrimary = UIColor(hex: "#1A73E8")
    • Android: <color name="color_brand_primary">#1A73E8</color>
  2. Consumption — Engineers reference tokens instead of hardcoded values. In CSS, that means background-color: var(--color-brand-primary). Components never contain raw hex codes or pixel values.

Tokens are typically organized in tiers: global tokens (raw palette), alias/semantic tokens (e.g., color.action.primary referencing the global token), and component tokens (e.g., button.background.default referencing the alias). This layering is what makes theming—like dark mode—trivial: you swap alias mappings, and every component updates.

When to use it

Design tokens make sense when your project crosses at least one of these thresholds:

Use tokens when:

  • You maintain a design system used by more than one team or product
  • You ship to multiple platforms (web + native mobile)
  • You need theming support: dark mode, white-labeling, or brand variants
  • Your Figma source of truth and codebase keep drifting apart
  • You're building with a component library (React, Vue, Svelte) and want predictable styling

Skip tokens when:

  • It's a solo-dev project with a single CSS file and no plans to scale
  • You're prototyping something throwaway—tokens add a build step
  • Your team hasn't agreed on design foundations yet; tokens codify decisions, they don't make them for you

Our preferred stack is Figma Variables → Tokens Studio plugin → Style Dictionary v4 → CSS custom properties (for web) with Tailwind config generated from the same source.

Design Tokens vs alternatives

Approach Scope Platform Support Theming Tooling
Design Tokens (DTCG) Full system Multi-platform (web, iOS, Android) First-class (alias layers) Style Dictionary, Tokens Studio
CSS Custom Properties Web only Browser CSS Manual swap via class/data-attr Native browser feature
Figma Variables Design tool Figma only (until exported) Modes (light/dark) in Figma Built into Figma (2023+)
Sass/Less Variables Web preprocessor CSS output only Compile-time only, no runtime swap Sass CLI, webpack loaders
Tailwind Config Utility CSS Web only darkMode config Tailwind CLI

CSS custom properties are an output format for tokens, not a replacement. Figma Variables are a design-side representation. Tokens are the bridge that keeps both sides in sync. The DTCG spec is specifically designed to be the interchange format between tools.

Real-world example

We built a multi-brand e-commerce platform where three retail brands shared a single Next.js codebase. Each brand had its own color palette, type scale, and spacing rhythm. We defined ~280 design tokens in DTCG-format JSON, organized into global and alias tiers. Style Dictionary v4 generated three CSS files—one per brand—totaling about 4 KB each. At runtime, the correct file loaded based on the hostname, swapping every color, font-size, and spacing value across 60+ shared React components. Adding a fourth brand later took one designer two days in Figma and one engineer half a day to wire up the new token set. Zero component code changed.

Frequently asked questions about Design Tokens

Are design tokens the same as CSS custom properties?
No. CSS custom properties (`--my-color: #fff`) are one *output format* for design tokens, but tokens themselves are platform-agnostic. A single token definition can generate CSS custom properties for the web, Swift constants for iOS, and XML resources for Android. CSS custom properties live only in the browser runtime. Design tokens live in a source-of-truth file (usually JSON) and are transformed at build time into whatever format each platform needs. Think of tokens as the canonical definition and CSS custom properties as one of several translations.
When did design tokens become a standard?
Salesforce coined the term around 2014 with the Lightning Design System. The concept gained wider adoption between 2017-2020 as Style Dictionary (by Amazon) became the de facto build tool. The W3C Design Tokens Community Group formed in 2019 to create a formal specification. Their DTCG format draft reached its second editor's draft in late 2023. As of April 2026, the spec isn't a W3C Recommendation yet, but tools like Style Dictionary v4, Tokens Studio, and Figma Variables already align with its `$value`/`$type` conventions. It's a de facto industry standard even without full W3C ratification.
What's the alternative to design tokens?
The most common alternative is hardcoding values directly in component styles or using preprocessor variables (Sass, Less). This works fine for small, single-platform projects. For theming, some teams use CSS custom properties manually without a formal token layer—defining variables in a `:root` block and swapping them via class toggles. Tailwind CSS config files also serve as a centralized value store for web projects. The trade-off: all of these are web-only or tool-specific. If you need cross-platform consistency or a sync pipeline between Figma and code, there's no real substitute for a proper token system.
How do you sync design tokens between Figma and code?
The most reliable pipeline we've used is Figma Variables → Tokens Studio plugin → Git repository → Style Dictionary build. Tokens Studio can read Figma Variables and export them as DTCG-compatible JSON, which it commits directly to a Git branch. A CI step runs Style Dictionary to generate platform outputs (CSS, Swift, etc.), and engineers consume those artifacts. This creates a two-way-ish workflow: designers update tokens in Figma, the plugin pushes to Git, and code stays in sync. The reverse—code changes updating Figma—is less mature, but Tokens Studio supports pushing back to Figma from JSON. We run this on most of our design system projects.
Get in touch

Let's build
something together.

Whether it's a migration, a new build, or an SEO challenge — the Social Animal team would love to hear from you.

Get in touch →