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
      • Figma Data Limits
    • 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
  • Styles with Variable References
  • How it works
  • 1. Token setup
  • 2. Create the Variables being referenced.
  • 3. Create the Styles
  • Export from Themes (pro)
  • Export from Token Sets
  • 4. Troubleshooting
  • Resources

Was this helpful?

Edit on GitHub
Export as PDF
PreviousVariables Skipped on ExportNextImport from Figma Guide

Last updated 4 months ago

Was this helpful?

Styles with Variable References

For the Figma Styles which support Variable values, you can create and manage Styles with Variables references attached to your Design Tokens using the Tokens Studio Plugin for Figma.

This allows you to take advantage of the workflow benefits of working with Tokens Studio in Figma while sharing Styles and Variables with consumers of your Figma libraries.

If this is your first time Exporting to Figma, you'll want to get familiar with the basics of the process, then come back to this guide.


How it works

This is a multi-step process that involves a bit of prep work to allow the Plugin to attach your Tokens to the right features in Figma.

Each Token Type that supports Styles with Variable References, specific steps are included in its guide. However, the steps below outline the basics of how tis feature works.

1. Token setup

Before you export your desired Tokens to Figma as Styles, ensure your Tokens have been created with Values that reference another token.

It's important that the Tokens being referenced as the value have a unique name from the Token being exported as Styles.

For Color Styles, you may need to split the Tokens being exported as Styles in a separate Token Set from the Tokens referenced in the value which are to be exported as Variables as the Plugin only supports exporting entire Sets or Themes to Figma.

2. Create the Variables being referenced.

If you haven't already, complete the Export to Figma as Variables process for the Tokens being referenced as the values of the Tokens you want to export as Styles.

The plugin can only attach a Token by name to a Style or Variable, not both.

If needed, delete and detach any Variables you want to be created as styles.

3. Create the Styles

In order for the plugin to attach your Styles to the Variables you created, you may have to configure the status of Token Sets included in the export.

The process is slightly different if you are Exporting from Themes or Token Sets.

Export from Themes (pro)

  • Open the Theme you want to Export as Styles

  • Ensure your Theme configuration has:

    • Token Sets being Exported as Styles are Enabled.

    • Token Sets being referenced in their values may need to be set as Reference only

  • Confirm and save the Theme configuration and close the Theme modal.

Open the Export to Styles and Variables modal and select your Export Options:

  • The Style Types you want to create are selected (checkmark visible).

  • The Create Styles with Variable references is selected (switch is on).

  • Select Confirm to save your configuration and close this menu.

    • You can open this menu anytime using the Options button at the bottom of the Export to Figma modal.

Select the Themes you want to Export as Styles.

Ensure the themes you have exported as Variables are not selected.

Check the newly created Styles.

  • If the values are showing hard-coded values instead of your variables, don't worry!

    • There's a known issue with the plugin where occasionally it needs to create the styles before it can attach the Variable references.

  • Repeat the Export to Styles flow again, and the plugin will be able to map your variables to your styles.

When you see the name of your Variables in the values of the Styles, the process is complete!

Export from Token Sets

If you are Exporting your Tokens from Token Sets, open the Export to Styles and Variables modal and select your Export Options to ensure:

  • The Style Types you want to create are selected (checkmark visible).

  • The Create Styles with Variable references is selected (switch is on).

  • Select Confirm to save your configuration and close this menu.

    • You can open this menu anytime using the Options button at the bottom of the Export to Figma modal.

From the Token Sets page, select the Change Sets Button to review your Token Set configuration.

Review your Token Set configuration:

  • Token Sets being Exported as Styles are Enabled.

  • Token Sets being referenced in their values may need to be set as Reference only.

  • Save and confirm.

  • Select the Export to Figma button

Check the newly created Styles.

  • If the values are showing hard-coded values instead of your variables, don't worry!

    • There's a known issue with the plugin where, occasionally, it needs to create the styles before it can attach the Variable references.

  • Repeat the Export to Styles flow again, and the plugin will be able to map your variables to your styles.

When you see the name of your Variables in the values of the Styles, the process is complete!

If you have unexpected results, read the Troubleshooting section below.


4. Troubleshooting

Here are the common issues you might run into the first couple of times you try this process.

Styles created with the correct values but not attached to Variables

If the Tokens you exported are created as styles with the correct value, but they are missing the connection to the attached Variable, the plugin is missing the information it needs to attach it to a variable.

  • Ensure the Tokens you Exported have values that are referencing existing Tokens.

    • Values are the name of a token inside curly brackets: {token-name}

  • Ensure the Tokens being referenced have been created as Variables

    • If not:

      • Export to Figma as Variables for the Referenced Tokens so they are created

      • Then repeat the Export to Figma as Styles step above

Ensure the Create Styles with Variable references option is enabled

Styles created with empty values

If the Tokens you exported were created as Styles, but the values are "empty", the plugin is missing the information it needs to populate the values.

  • Ensure the Token Sets containing the Tokens being referenced in the Values have a status of enabled or reference only.

  • Ensure the Token Sets containing the Tokens being Exported as Styles have a status of Enabled

Styles created with partial values attached to Variables

If the Tokens you exported were created as Styles, but some of the values are hard-coded and others are referencing Variables, the plugin is missing a connection to some the Variables.

Check your Token Values and Token Types for compatibility as not all Token Values and Token Types are compatible with Variables.

A common example is Typography Composite Tokens with Percentage (%) in their values for Line Height or Letter Spacing.

  • The plugin will create the Text Style and show attached Variable references for most properties.

  • The values with percentages will remain as hard-coded values because Figma does not support numeric values with units.

Select a Token Type guide below for more details that are helpful in troubleshooting.


Resources

Figma resources:

Community resources:

Known issues and bugs

Requests, roadmap and changelog

Pay close attention to your and ensure the Tokens you want to export as Styles are NOT exported as Variables.

If you are , navigate to the Themes feature in the plugin.

Check your Token Values -

Check your Export Options -

Check your Theme and Token Set configuration outlined in

→

→

Design in Figma -

The Tokens Studio collection of Variable videos -

Our friends at have free learning resources on Variables -

Tokens Studio Plugin GitHub -

Tokens Studio Plugin GitHub -

Tokens Studio Plugin GitHub -

Add support for scoping and publishing variables and styles -

Ignore parts of the token name for variables and styles -

Theme Switcher for non-DS designers so I don't need variables anymore -

Tokens applied with Figma UI as Styles or Variables are Fragile -

Create Variable Collections With The Plugin's Order of Themes -

Show updated number of Variables (or styles) when exporting to Figma with updated values -

→ Read the Token Values with References guide for more details
Export to Figma Guide
Export Options
→ Jump to the Detach Styles and Variables guide for more details
→ If your Variables live in a different Figma file, you may want to check out the Non-Local Variables guide for those specific steps.
Exporting your Tokens from Themes
Read the Export to Figma Overview for a list of compatible Token Types
Read the Export to Figma Skipped Variables guide for reasons why certain Values may not be referenced properly.
Overview of Variable Collections and Modes
YouTube Playlist
UI Collective
YouTube Playlist
Open issues Styles with Variable reference
Open issues for Figma Variables
Open issues for Figma Styles
Feature Request
Feature Request
Feature Request
Feature Request
Feature Request (blocked by Figma)
Feature Request
↓ If you have unexpected results, read the Troubleshooting section below.
Step 1 Above ↑
Step 3 Above ↑
Step 3 Above ↑
Export to Figma Guide
Token setup in the Plugin.
Create the Variables connected to the Tokens being referenced in the Styles.
Create the Styles.
Troubleshooting

💡 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

💌 Visit to contribute or subscribe to updates.

https://feedback.tokens.studio/
Page cover image
Cover

Color Tokens

Can be exported as Color Styles.

Cover

Typography Tokens

Can be exported as Text Styles

Cover

Box Shadow Tokens

Can be exported as Effect Styles

Select the Export Styles and Variables from the Tokens page to configure the Options. Be sure the Variable types are selected and no Styles are selected.
Once you've confirmed your Export Options, the Plugin brings you the place where you select which Tokens to export.
Select the Export Styles and Variables from the Tokens page to configure the Options. Be sure the Toggle for Create styles with variable referencesis enabled.
After the Export Options are confirmed, all previously created Themes are displayed. In this example, only the mode/darkTheme is selected (checkmark visible) for export. The Options button is highlighted to show how to open the menu.
Select the Export Styles and Variables from the Tokens page to configure the Options. Be sure the Toggle for Create styles with variable referencesis enabled.
Pressing the Change Sets modal opens the list of all Sets. Adjusting the Set Status tells the plugin how to export the Tokens living within each set.
A Text Style created with Variable References from the Plugin will leave properties with percentage values attached to the Token value and not a Variable. The remaining text properties will be attached to Variables.
Cover

Non-local Variables and Styles.

Steps for when your Variables live in a different Figma file.

Cover

Color Tokens

Specifics on exporting as Color Styles with Variable References.

Cover

Typography Tokens

Specifics on exporting as Text Styles with Variable References.

Cover

Box Shadow Tokens

Specifics on exporting as Effects Styles with Variable References.

Cover

Export to Figma Guide

A comprehensive list of Token Types and their compatible Variable Types.

Cover

Skipped Variables

Detailed reasons why not all Tokens can be Exported as Variables.

Cover

Export from Themes (pro)

Review the steps of Exporting to Figma from Themes.

Cover

Export from Token Sets

Review the steps of Exporting to Figma from Token Sets.

Cover

Export Options

Review what each Export Option does in detail.