Tokens Studio for Figma
  • Getting Started
    • Tokens Studio Plugin for Figma
    • Install the Figma Plugin
    • Pro Licence for the Figma Plugin
    • Join the Slack Community
    • Feature Requests - Featurebase
    • Changelog - Featurebase
  • Design Token Fundamentals
    • Intro to Design Tokens
      • Token Anatomy - Type
      • Token Anatomy - Value
      • Token Anatomy - Description
      • Token Anatomy - Name
  • Token Management
    • Token Types
      • Asset
      • Boolean
      • Border - Composite
      • Box Shadow - Composite
      • Color
        • Modified Colors (pro)
        • Gradient Colors
      • Dimension
        • Border Radius
        • Border Width
        • Sizing
        • Spacing
      • Number
      • Opacity
      • Other
      • Text (string)
      • Typography - Composite
        • Font Family
        • Font Weight
        • Font Fallbacks
        • Font Size
        • Line Height
        • Letter Spacing
        • Paragraph Indent
        • Paragraph Spacing
        • Text Case
        • Text Decoration
      • Composition (legacy)
    • Token Values
      • Token Values with References
      • Using Math in Token Values
    • Token Names
      • Token Name Technical Specs
      • Token Groups
      • Edit Token Names
    • Token Description
    • Token Sets
      • JSON View
  • Themes management
    • Themes (pro)
    • Themes that switch
  • Working in Figma
    • Variables and Tokens Studio
    • Styles and Tokens Studio
    • Export to Figma Guide
      • Export Options
      • Export Using Themes (pro)
      • Export Using Token Sets
      • Variables Skipped on Export
      • Styles with Variable References
    • Import from Figma Guide
      • Import Styles from Figma
      • Import Variables from Figma
        • Connect Themes to Imported Variables
        • Imported Variable Types and Token Types
    • Non-local Variables and Styles (pro)
    • Remove Tokens from Figma elements
    • Dev Mode in Figma
  • Settings Management
    • Plugin Settings
    • Base Font Size Setting
    • Token Format - W3C DTCG vs Legacy
  • Token Storage and Sync Integrations
    • Local Document - Figma File Token Storage
    • Remote Token Storage Integrations
      • GitHub - Git Sync Provider
      • GitLab - Git Sync Provider
      • Bitbucket - Git Sync Provider
      • Azure DevOps - Git Sync Provider
      • JSONBin - Cloud Sync Provider
      • Supernova - Cloud Sync Provider
      • Tokens Studio Platform - Cloud Sync Provider
      • URL - Server Sync Provider
      • Generic Versioned Storage - Server Sync Provider
    • Multi-file Sync to Remote Storage (pro)
    • Manage Sync Providers
      • Edit Sync Provider
      • Change Active Sync Provider
      • Remove Sync Provider
    • Sync Changes to Remote Storage - Push and Pull
    • Branch Switching (pro) - Version Control
  • Inspect and Debug Tokens
    • Inspect Tokens
    • Remap Tokens
  • Transform Tokens for Development
    • Style Dictionary + SD Transforms
    • Official docs for Style Dictionary
  • Style Dictionary Playground
  • Troubleshooting
    • Reset Tokens from Dev Console
    • Tokens Studio Status
  • Open Source
    • Contribute
    • Shared Plugin Data
Powered by GitBook
On this page
  • Token formats W3C DTCG vs Legacy
  • What's the difference?
  • In the plugin
  • 1. Settings page
  • 2. Sync actions
  • Convert between Token Formats
  • Transforming Tokens
  • Resources

Was this helpful?

Edit on GitHub
Export as PDF
PreviousBase Font Size SettingNextLocal Document - Figma File Token Storage

Last updated 4 months ago

Was this helpful?

Token formats W3C DTCG vs Legacy

In support of moving towards the , as managed by the Design Tokens Community Group (DTCG), you can choose a Design Token Format (how tokens are written in their JSON files) from within the Tokens Studio Plugin.

  • Current Tokens Studio "legacy" format

  • W3C DTCG spec format

What's the difference?

The DTCG format prefixes the properties of a design token in the JSON file with the dollar sign ($)

  • $value

  • $type

  • $description

Restrictions of special characters in token names are introduced to support this:

  • {

  • }

  • $

When creating Token names with these characters, an error message appears, and the action is blocked.


In the plugin

The choice of Token Format can be defined for Tokens stored in the local file or remote via a sync provider. For Git sync providers, different branches can have different Token Formats.

You can select a token format in two locations:

  1. Plugin settings > sync/storage providers.

  2. Sync actions at the bottom of the plugin when a remote storage provider is active.

You can change between the W3C DTCG and Legacy token formats at any time by following the steps below.

1. Settings page

On the plugin's settings page, you can see the Token Format being used in your file next to your token storage provider.

  • The default is legacy format

  • When you make the switch, you'll see W3C DTCG format

Tokens stored on the local document

If your tokens are stored locally in the Figma file (no external storage or sync providers), the Token format action is to the right of the local document option.

Tokens stored externally

When your tokens are stored externally via Sync providers the token format for the active sync provider will show.

The token format for other sync providers will be hidden.

2. Sync actions

When synced to external storage, the current token format also appears at the bottom of the plugin alongside the other Sync provider actions.

It's possible for different branches of a sync provider to have different token formats, so you can select the Token format icon button to switch formats if needed.

Convert between Token Formats

Select the Token format indicator to start the process of changing formats (from the settings page or sync actions):

  • A Token format modal appears to explain the process.

  • Confirm your decision to switch formats.

  • The plugin will convert your token JSON files to the format of your choice.

The plugin will convert your token JSON files to the format of your choice without any further action from you.

Push changes to remote storage

If you have unsaved changes that need to be synced to a remote storage provider that requires it, the plugin will prompt you to push changes so you don't lose your work.

  • A new branch is automatically created for you with updated JSON files.

  • The push changes modal will open.

  • A pre-filled commit message is added to help your engineers know what to do when they receive your changes.

  • Follow the prompts in the plugin to push changes to your sync provider.

Once you've synced your changes, the plugin will automatically have you working in the newly created branch. You'll see the W3C DTCG Token Format indicators next to the branch name at the bottom of the plugin.


Transforming Tokens

When your design token format is set to W3C DTCG Format using the steps above, you'll need to configure Style Dictionary to support this.

For each Token Type the SD-Transforms package will automatically convert the Tokens Studio specific Token Type to align with the DTCG Format Token Type where necessary.


Resources

Mentioned in this doc:

Community resources:

  • None yet!

Known Issues and Bugs

  • Remove composition tokens [#2800](# Remove composition tokens #2800)

Requests, roadmap and changelog

  • None

→

The DTCG and their accepted values, which we will support in future releases.

→

→

→

SD-Transforms -

Style Dictionary -

Style Dictionary -

Design Tokens Community Group -

Tokens Studio Plugin GitHub -

Add empty line when writing to files (sync providers + local export)

Tokens Studio Plugin Github -

Change boxShadow values from x and y to offsetX and offsetY

Allow description in token groups

Learn more about Token Names based on their Technical Specifications.
specifies additional token types
Learn more about the Branch Switching (pro) feature
Style Dictionary V4 Utils - convertToDTCG
SD-Transforms Read-Me Doc, Using the preprocessor
Token Types
Read Me
convertToDTCG
https://styledictionary.com/
W3C Draft
Open issues for Token Format
#2970
Open issues for W3C DTCG
#2052
#1811
W3C Specifications for Design Tokens

Engineers typically transform Tokens used in code with , which is tool-agnostic. Tokens coming from Tokens Studio require an additional step: , an npm package that prepares Tokens for Style Dictionary.

Style Dictionary
@Tokens-studio/sd-transforms

💌 Visit to contribute or subscribe to updates.

https://feedback.tokens.studio/
From the Tokens Page of the plugin, the JSON view is selected and annotated to show the difference between Token Formatting. The image on the left shows "legacy" Token Format. The image on the right shows "W3C DTCG" Token Formatting.
In the Plugin, you can initiate the Token Format conversion process from the Settings Page by selecting the Format for the current Token Project or the Sync Provider Actions at the bottom of the Plugin.
The Settings page of the Plugin is shown with the Token project data stored locally. The image on the left shows the Token Format as "legacy". The image on the right shows the Token Format as "W3C DTCG".
The Settings page of the Plugin is shown with the Token project data synced to Github. The image on the left shows the Token Format as "legacy". The image on the right shows the Token Format as "W3C
The Tokens page of the Plugin displays several Color Tokens in the JSON view. The image on the left shows the Token Format as "legacy" indicated by the icon next to the branch called "main. The image on the right shows the Token Format as "W3C DTCG" indicated by the icon next to the branch called "w3c-dtcg-conversion".
From the Settings page of the Plugin, select the current Token Format next to the active sync provider to start the conversion process. The images above show the flow of local document storage of Token data.
From the Settings page of the Plugin, select the current Token Format next to the active sync provider to start the conversion process. The images above show the flow of remote storage of Token data using Github as the sync provider.
After completing the sync to remote Token storage provider process, the sync provider actions at the bottom of the plugin show a newly created branch called "w3c-dtcg-conversion" next to the icon for W3C DTCG Token Format. Select the JSON View from the Tokens page to see the newly formatted JSON files.
Page cover image

💡 Something to share?

Submit it here!

🐞 If you are experiencing an issue not listed here, please reach out to us on the Troubleshooting channel of our , , or send us an email support@tokens.studio

community Slack
submit it on our feedback tool