Tokens


Design Tokens are defined by our Designers, with the source of truth located in Figma. This guide serves as a bridge between Figma and Components, transforming Figma variables into meaningful outputs.


Reading Tokens

  1. To effectively read Wix Design System tokens, you need access to our Figma spec.
  2. To read the tokens from the Figma spec, you need either:
    • Dev mode (recommended)
    • Edit rights

Dev Mode

  1. Enter Dev Mode by pressing Shift+D (Mac) or clicking the Dev Mode toggle button in the UI. If you have trouble entering Dev Mode, refer to this guide.
  2. Navigate to the Plugins tab.
  3. Search for the Token Lab plugin and install it.
  4. Use the Token Lab plugin to export tokens. This will output the tokens in JSON format.

After completing these steps, you will have a JSON file with all the WDS tokens in the Token Lab format. This file is divided by token levels (Foundation, Semantic, and Component) and themes (wds, studio, and wixel).

Copy

Writing Tokens

Tokens are stored in the src/tokens directory, organized similarly to Token Lab tokens by theme (default (wds), studio, odeditor, odeditor-dark, and studio2-light) and by level (foundation, semantic, and component). Note that the Token Lab output isn't compatible with the Style Dictionary format, so you can't use it directly as a source for Style Dictionary.

Updating Style Dictionary JSON

Since Token Lab output isn't directly compatible with the format that Style Dictionary uses, you need to either:

  • Extract and add values manually (recommended for small changes)
  • Process Token Lab output and insert it into the Style Dictionary JSON (recommended for large changes)

Extract and add values manually

For small updates, it's usually quicker to do this manually. Create new entries in the appropriate .json files for the relevant level and theme based on the Token Lab output.

Here's how to do this:

  1. In Figma, you receive a variable name like color.text.primary.
  2. Identify that this is a foundation token. You can determine this from Figma, as every variable belongs to one of these categories: foundation, semantic, or component.
  3. Navigate to packages/wix-design-system-tokens/src/tokens/INSERT_THEME_NAME/foundation.json.
  4. Find the color object and check for a nested object called text. If it doesn't exist, create it along with another nested object for the primary key. So it will result in color.text.primary objects sequence.
  5. Repeat this process for all relevant themes.

Process output and insert

For larger numbers of tokens, adding them manually can be tedious. Our figma-to-dictionary script can help by sanitizing and transforming Token Lab output to match the format used by Style Dictionary. Here's how to use figma-to-dictionary:

  1. Create a figma-to-dictionary/input.json file.
  2. Copy the tokens you want to add from the Token Lab output into input.json.
  3. Run the script:
Copy

This creates a figma-to-dictionary/output.json file with processed tokens.

  1. Copy tokens from figma-to-dictionary/output.json and insert them into the respective .json file in the src/tokens directory.
    • BEWARE: There might be incorrectly exported tokens, as this script isn't waterproof, so manual adjustments may be necessary.

Generating Style Dictionary Output (CSS variables)

Once the .json files are updated, you can generate the new Style Dictionary output. To do this, first navigate to packages/wix-design-system-tokens and run:

Copy

Then, navigate back to the main entry of monorepo folder and run:

Copy

This script creates all the output files like .css and .st.css, which are later used in components.






Last updated: 26 October 2026

Did this help?