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.
Export to Figma GuideHow 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.
→ Read the Token Values with References guide for more details
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.
Export to Figma GuidePay close attention to your Export Options and ensure the Tokens you want to export as Styles are NOT exported as Variables.

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)
If you are Exporting your Tokens from Themes, navigate to the Themes feature in the plugin.
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.

Create styles with variable references
is enabled. Select the Themes you want to Export as Styles.
Ensure the themes you have exported as Variables are not selected.

mode/dark
Theme is selected (checkmark visible) for export. The Options button is highlighted to show how to open the menu. 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.
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.

Create styles with variable references
is enabled. 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.
Check your Token Values - Step 1 Above ↑
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
Check your Export Options - Step 3 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.
Check your Theme and Token Set configuration outlined in Step 3 Above ↑
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.
→ Read the Export to Figma Overview for a list of compatible Token Types
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.

Non-local Variables and Styles.
Steps for when your Variables live in a different Figma file.
Resources
Figma resources:
Design in Figma - Overview of Variable Collections and Modes
Community resources:
The Tokens Studio collection of Variable videos - YouTube Playlist
Our friends at UI Collective have free learning resources on Variables - YouTube Playlist
💡 Something to share? Submit it here!
Known issues and bugs
Tokens Studio Plugin GitHub - Open issues Styles with Variable reference
Tokens Studio Plugin GitHub - Open issues for Figma Variables
Tokens Studio Plugin GitHub - Open issues for Figma Styles
🐞 If you are experiencing an issue not listed here, please reach out to us on the Troubleshooting channel of our community Slack, submit it on our feedback tool, or send us an email [email protected]
Requests, roadmap and changelog
Add support for scoping and publishing variables and styles - Feature Request
Ignore parts of the token name for variables and styles - Feature Request
Theme Switcher for non-DS designers so I don't need variables anymore - Feature Request
Tokens applied with Figma UI as Styles or Variables are Fragile - Feature Request
Create Variable Collections With The Plugin's Order of Themes - Feature Request (blocked by Figma)
Show updated number of Variables (or styles) when exporting to Figma with updated values - Feature Request
💌 Visit https://feedback.tokens.studio/ to contribute or subscribe to updates.

Last updated
Was this helpful?