Design Tokens

Design Tokens

Design Tokens

Design tokens are the foundational elements of our design system that store visual design attributes.

Introduction

Design tokens are the foundational elements of our design system that store visual design attributes. They help us maintain consistency across platforms while enabling flexibility for different brand expressions. This documentation covers how to use our design tokens across the React Library, Spec Library, and Design Library.

Color Tokens

Guide

Color tokens are named entities that store specific color values in our design system. They create a layer of abstraction that allows for consistent color application while making system-wide updates more manageable.

Our color tokens follow a hierarchical structure:

  • Global Tokens: Represent the raw color values (e.g., color.blue.500)

  • Semantic Tokens: Convey purpose rather than visual attributes (e.g., color.background.primary)

  • Component Tokens: Specific to individual components (e.g., button.background.primary)

Token Naming Convention

Our tokens follow this pattern:

{category}.{concept}.{property}.{scale/state}

For example:

  • color.background.primary

  • color.text.error.hover

  • spacing.component.medium

Text Color Tokens

This table excludes hover and active tokens

Token

Example

color-text-primary-label

Modal title, section title

color-text-primary-interactive

Secondary button

color-text-primary-paragraph

Onboarding, modal paragraphs

color-text-secondary-label

Input label

color-text-secondary-interactive

Tab, view switcher

color-text-secondary-paragraph

Onboarding, modal paragraphs

color-text-tertiary-label

Info icon

color-text-tertiary-interactive

Input placeholder

color-text-tertiary-paragraph

Paragraphs

color-text-inverse

Primary button

color-text-info-primary

Info banner

color-text-link

Link text, icon

color-text-info-success

Success banner

color-success

Success text, icon

color-text-info-warning

Warning banner

color-text-warning-icon

Warning icon

color-text-warning

Warning text

color-text-info-error

Error or Alert banner

color-text-error

Error text, icon

color-text-destructive

Destructive text, icon

color-text-nav-title

Header title

color-text-nav-primary-interactive

Header link, input text

color-text-nav-primary-paragraph

Paragraph text

color-text-nav-secondary-interactive

Secondary links, icon

color-text-nav-secondary-paragraph

Secondary paragraph text

color-text-nav-primary-label

Input label icon

color-text-nav-secondary-label

Input label icon

color-text-nav-placeholder

Input placeholder

color-text-nav-info-primary

Nav menu tag

Border Color Tokens

This table excludes hover and active tokens

Token

Example

Color-Border-Separator

Horizontal separator, table separator

Color-Border-Separator-Contrast

Vertical separator, second level line

Color-Border-Interactive

Button, input field, usually paired with base-alt

Color-Border-Small-Elements

Checkboxes, radios, toggles

Color-Border-Overlay

Tooltips, dropdown menus

Color-Border-Dark-Tooltip

Tooltips that are dark in both themes

Color-Border-Active

Active input field

Color-Border-Primary-Button-Separator

Primary button group separator

Color-Border-Focus

Focus states

Color-Border-Success

...

Color-Border-Warning

Warning input field

Color-Border-Error

Error input field

Color-Border-Destructive-Button-Separator

Destructive button group separator

Color-Border-Nav-Active

Active search

Color-Border-Nav-Separator

Separators

Color-Border-Nav-Separator-Active

Active menu item separator

Color-Border-Nav-Overlay

Header search menu

Background Color Tokens

This table excludes hover and active tokens

Token

Example

Color-Background-Base

Button, input, table placed on body or base alt.

Color-Background-Base-Alt

Button, input, table placed on base.

Color-Background-Body

Page background.

Color-Background-Neutral–Selected

Active view switcher tab.

Color-Background-Secondary

...

Color-Background-Tertiary

...

Color-Background-Inverse

Slider handle.

Color-Background-Base-Expanded

Expanded row, table filter.

Color-Background-Info-Neutral

Neutral tag, neutral step badge.

Color-Background-Small-Elements

Checkbox, radio, toggle.

Color-Background-Modal-Underlay

...

Color-Background-Dark-Tooltip

Dark tooltips in both themes.

Color-Background-Base-Active

Selected side menu page.

Color-Background-Info-Primary

Banner, label, completed step.

Color-Background-Primary

Primary button, badge.

Color-Background-Focus

Focus states.

Color-Background-Info-Success

Banner, tag.

Color-Background-Success

Success badge.

Color-Background-Info-Warning

Banner, tag.

Color-Background-Warning

Warning badge.

Color-Background-Info-Error

Banner, tag.

Color-Background-Error

Error badge.

Color-Background-Destructive

Destructive button.

Color-Background-Nav-Base

Header background.

Color-Background-Nav-Base-Alt

Search background.

Color-Background-Nav-Base-Active

Selected nav menu item.

Color-Background-Nav-Primary

Primary nav menu badges.

Color-Background-Nav-Success

Success nav menu badges.

Color-Background-Nav-Warning

Warning nav menu badges.

Color-Background-Nav-Error

Error nav menu badges.

Color-Background-Nav-Info-Primary

Nav menu tag.

Opacity Tokens

Token

Example

opacity-disabled (50%)

Disabled components

opacity-modal-underlay (40%)

Modal, tutorial underlay

opacity-fade-30 (30%)

...

opacity-fade-50 (50%)

...

opacity-loading-underlay

Loading underlay

Shadow Tokens

Token

Example

Shadow

Popover, dropdown

Shadow-Right

Left side fixed column

Shadow-Left

Right side fixed column

Shadow-Top

Sticky footers

Inner-Shadow-Input-Focus

Focused inputs

Themes

Our design system supports multiple themes through token aliasing. Each theme maintains the same token names but maps to different values depending on the active theme.

Available Themes

  • Light (default before 25.5)

  • Dark

  • High Contrast (default after 25.5)

Spacing Tokens

Currently, the only tokens used in production are the basic spacing tokens.

Token

Size

XS

5px

S

10px

M

15px

L

20px

XL

30px

XXL

40px

Figma

Our Figma libraries leverage design tokens through Figma variables. This ensures that designs created in Figma use the same values that will be implemented in the final product.

Using Tokens in Figma

  1. Accessing Design Tokens

    • Open your Figma file

    • Click on the "Variables" icon in the right sidebar (diamond shape)

    • Browse available variables organized by category (colors, spacing, etc.)

    • Hover over a variable to preview its current value


  2. Applying Tokens to Properties

    • Select an element in your design

    • In the property panel (right side), locate the property you want to modify (fill, stroke, etc.)

    • Click the four-dot icon to the right of the property

    • Select "Choose variable" from the dropdown

    • Browse and select the appropriate token variable


  3. Creating New Elements with Tokens

    • When creating new shapes, text, or other elements

    • Apply variables to their properties instead of using static values

    • For text elements, apply typography tokens to ensure consistent font styles


  4. Working with Composite Tokens

    • Some properties may reference multiple tokens

    • For example, a shadow might use opacity, blur, and color tokens together

    • Apply these through component properties when available

Theme Switching

Our design system supports dynamic theme switching across all platforms and implementations. Development teams will handle the technical implementation of theme switching in applications, but designers should design with theme adaptability in mind.

Changing Themes in Figma

Designers can preview and test designs across different themes using Figma's built-in variable mode switching:

  1. Access the Variables Panel

    • Open your Figma design file

    • Click on the "Variables" icon in the right sidebar

    • The Variables panel will display all available variable collections


  2. Switch Between Themes

    • Look for the "Mode" dropdown at the top of the Variables panel

    • Select from available themes: "Light" (default), "Dark", or "High Contrast"

    • Your design will update in real-time to reflect the selected theme


  3. Testing Theme Compatibility

    • Create a dedicated artboard for each theme variant

    • Use components that reference design tokens (variables)

    • Duplicate screens and switch modes to compare appearances

    • Verify accessible contrast ratios in each theme


  4. Theme Switching in Prototypes

    • You can create interactive theme switching in Figma prototypes:

      1. Create a theme toggle component

      2. Set up variable mode switching interactions

      3. Connect the toggle to mode changes in your prototype

      4. Test the user flow of changing theme

Variable vs Styles

Design Tokens as Variables

Design tokens implemented as variables provide:

  • A single source of truth

  • Consistent naming conventions

  • Easier theme switching

  • Simplified maintenance

In Figma, variables represent our design tokens and allow for dynamic changes across themes.

Figma Variables vs Styles

Variables (Recommended)

  • Store individual property values

  • Support multiple themes through modes

  • Can be used across multiple properties

  • Enable algebraic operations (e.g., spacing calculations)

  • Allow for inheritance and aliases

Styles (Limited Use)

  • Combine multiple properties into one preset

  • Cannot adapt to theme changes without manual updates

  • Less flexible for system-wide changes

  • Useful for complex, composite elements

When to Use Variables vs Styles in Figma

Use Variables for:

  • Color values

  • Spacing measurements

  • Typography properties

  • Border radii

  • Shadow values

  • Opacity settings

Use Styles for:

  • Complex text formatting not fully covered by variables

  • Effect combinations that need to be applied together

  • Legacy designs not yet converted to the variable system

Converting Styles to Variables

When migrating from styles to variables:

  1. Identify the token values in each style

  2. Create equivalent variables

  3. Replace style references with variable references

  4. Test across all theme modes

Help make this page more useful.

Help make this page more useful.

Help make this page more useful.

Help make this page more useful.