UX and information design

Design token

Defining design tokens in digital product architecture

Design tokens are the foundational, platform-agnostic key-value pairs that capture, store, and distribute an organization's core visual design decisions across digital platforms and codebases. Originally formulated by Jina Anne and the design team at Salesforce during the development of the Lightning Design System, design tokens represent the atomic sub-elements of a design system, encoding attributes such as colors, typography styles, spacing scales, elevation shadows, border radii, and animation timing curves into standardized, machine-readable data structures.

Prior to the introduction of design tokens, maintaining visual consistency across large multi-platform software portfolios was a chronic engineering nightmare. A brand redesign required frontend web developers to update hardcoded hex values in CSS files, iOS engineers to manually edit UIColor definitions in Swift codebases, and Android developers to update XML resource files. This manual, distributed workflow introduced pervasive visual discrepancies, slow development velocity, and chronic interdepartmental friction.

Design tokens resolve this fragmentation by establishing an authoritative, centralized single source of truth for visual styles. Design tokens store visual decisions in platform-neutral formats—predominantly JSON or YAML files. Automated build pipelines subsequently transform these abstract token definitions into platform-specific variables (such as CSS custom properties, Sass variables, Swift structs, and Android XML resources), allowing global design updates to propagate across all web, mobile, and desktop applications simultaneously.

Hierarchical token architecture: global, semantic, and component

Enterprise design systems organize design tokens into a disciplined, three-tiered hierarchical architecture: global tokens, semantic (alias) tokens, and component-specific tokens. This structured abstraction separates raw aesthetic values from their contextual business meaning, ensuring maintainability and flexibility at scale.

Global tokens (also termed reference or primitive tokens) define the absolute, context-free visual primitives of the design system. Examples include `color-blue-500: #1E40AF`, `spacing-16: 1rem`, and `font-family-sans: "Inter", sans-serif`. Global tokens define the raw visual palette available to the organization, but they do not prescribe how or where those values should be applied within user interfaces.

Semantic tokens (also known as alias or system tokens) layer contextual and functional meaning on top of global primitives, referencing global tokens rather than hardcoded values. Examples include `color-background-primary: {color-neutral-0}`, `color-interactive-default: {color-blue-500}`, and `color-text-danger: {color-red-600}`. Semantic tokens describe the purpose of the value, allowing designers to update theme definitions effortlessly. When switching an interface from light mode to dark mode, the semantic token `color-background-primary` dynamically remaps from white to dark gray without requiring changes to underlying UI components.

Component tokens represent the most granular tier, binding semantic tokens to specific UI elements and states. Examples include `button-primary-background: {color-interactive-default}` and `input-border-radius: {border-radius-sm}`. While component tokens introduce additional architectural overhead, they provide complete isolation, allowing designers to adjust the padding or hover state of a specific button component without inadvertently altering spacing across every other card or modal dialogue in the system.

Automation and transformation pipelines: Style Dictionary

The core technical mechanism that bridges design tokens between abstract design definitions and native production code is an automated token transformation engine, most prominently exemplified by Amazon's open-source Style Dictionary framework.

In modern token pipelines, design tokens are authored and maintained in version-controlled JSON repositories or exported directly from design tools like Figma using specialized plugins (such as Tokens Studio). When changes are committed to the token repository, Style Dictionary parses the JSON source files, evaluates token references across the semantic hierarchy, and executes platform-specific transformation routines.

```json { "color": { "brand": { "primary": { "value": "#2563EB" } } } } ```

The transformation pipeline compiles the neutral JSON token structure into multiple native code formats: - Web: Compiles tokens into standard CSS custom properties (`:root { --color-brand-primary: #2563EB; }`) or Sass variables. - iOS: Compiles tokens into native Swift classes or asset catalogs (`public static let colorBrandPrimary = UIColor(...)`). - Android: Compiles tokens into native XML color and dimension resources (`<color name="color_brand_primary">#2563EB</color>`) or Jetpack Compose theme files.

Automating token transformation through CI/CD pipelines ensures that frontend developers never manually copy or hardcode styling variables. Changes to the design language are published as versioned package releases (such as an npm package), enabling product engineering teams to update dependencies seamlessly.

Design-to-code synchronization with Figma

A transformative advantage of modern design tokens is establishing bidirectional synchronization between design tools and developer codebases. Historically, designers created UI components in Figma or Sketch, handing off static mockups that developers attempted to interpret manually. Design choices frequently drifted out of alignment with production code within weeks of deployment.

With modern design token integrations, design tools operate directly on the identical token variables utilized by production software. Using plugins like Tokens Studio for Figma or native Figma Variables, designers bind visual styles to centralized token definitions. When a designer changes a global spacing scale or updates the primary brand hue within Figma, the plugin exports the updated token JSON schema.

Through automated GitHub integrations, the design tool pushes a pull request directly to the organization's design system repository. Developers review the visual diff, automated continuous integration tests verify that no unintended regressions occur, and the updated tokens are compiled into production packages. This automated synchronization eliminates manual handoffs, uniting design and engineering around a shared operational source of truth.

Theming, multi-brand scalability, and dark mode

Design tokens provide unmatched architectural scalability for enterprises managing complex multi-brand portfolios, localized international sub-brands, and dynamic UI themes. In traditional development architectures, implementing a dark mode or launching a white-label version of an application required writing massive, redundant CSS overrides and duplicating component code.

In a token-based architecture, theming is achieved simply by swapping the underlying semantic token mapping layer while keeping the entire structural component codebase untouched. An enterprise banking platform operating multiple regional subsidiaries maintains identical core UI components—buttons, forms, and account cards. When rendering the application for Brand A, the system loads Brand A's token dictionary; when rendering for Brand B, the system loads Brand B's tokens, altering primary colors, corner radiuses, and fonts instantly with zero component refactoring.

Dark mode implementation becomes similarly straightforward. By creating parallel semantic token sets for light and dark contexts—mapping `color-surface-base` to pure white in light mode and deep charcoal in dark mode—the entire digital product portfolio adapts to user operating system preferences automatically. Design tokens transform theming from a high-maintenance engineering chore into an elegant, automated architectural capability.

Governance, naming conventions, and best practices

The long-term success of an enterprise design token system depends heavily on establishing strict naming conventions, clear governance rules, and cross-functional stewardship. A token system that uses ambiguous, inconsistent naming—such as `my-blue` or `special-padding`—rapidly creates confusion and leads developers to abandon tokens in favor of hardcoded values.

Best-practice token naming frameworks utilize structured, predictable syntax, such as the Category-Type-Item-Subitem-State (CTI) hierarchy. For example, the token name `color-text-interactive-hover` clearly communicates the category (color), context (text), function (interactive element), and UI state (hover). Establishing systematic naming conventions ensures that developers and designers can predict token names intuitively without constantly referencing documentation dictionaries.

Furthermore, organizations must establish formal governance processes for creating, modifying, and deprecating tokens. Core design system teams review token pull requests, preventing token bloat and ensuring semantic consistency across departments. By maintaining disciplined token governance, organizations build a durable, scalable design foundation that accelerates digital product delivery, enforces brand consistency, and elevates user experience across all digital customer touchpoints.

Frequently asked questions

What are design tokens and who invented them?

Design tokens are platform-agnostic, key-value variables that store visual design decisions—such as colors, typography styles, spacing, border radii, and shadows—in a centralized format (like JSON). The concept was originally pioneered by designer Jina Anne and the Salesforce team during the development of the Salesforce Lightning Design System to synchronize styles across multi-platform enterprise products.

How do design tokens differ from CSS custom properties?

CSS custom properties (CSS variables) are a web-specific styling technology that runs natively within web browsers. Design tokens are platform-neutral, abstract data structures (usually JSON) that represent design decisions before they are compiled. A design token transformation tool (like Style Dictionary) compiles design tokens into CSS custom properties for web, but also compiles those exact same tokens into Swift for iOS and XML for Android.

What is the difference between global tokens and semantic tokens?

Global tokens (primitives) define raw, context-free design choices (e.g., `blue-500: #2563EB`). Semantic tokens (alias tokens) map global tokens to functional, contextual meanings (e.g., `color-button-primary: {blue-500}`). Semantic tokens allow designers to change underlying themes, such as switching from light to dark mode, without modifying component code.

How do design tokens improve development velocity?

Design tokens accelerate development velocity by eliminating manual design handoffs and hardcoded styling updates. When a visual rebrand or style update occurs, updating the token in the centralized repository automatically updates web, iOS, and Android codebases through automated CI/CD pipelines, completing in minutes what historically required months of manual cross-platform code refactoring.

Related terms

  • Design system: A centralized ecosystem of reusable UI components, design tokens, and standards governing digital product design.
  • User experience: The overall perception and interactive experience an individual has when engaging with a product or system.
  • Information architecture: The structural design of shared information environments to facilitate usability and findability.
  • Visual hierarchy: The arrangement and presentation of visual elements in order of their importance to guide user perception.
  • Color contrast: The visual luminance difference between text and its background, critical for digital accessibility.
  • Cumulative Layout Shift: A web performance metric measuring the unexpected visual movement of page elements during rendering.