Skip to main content
Jason_Williams
New Participant
January 27, 2021

LAUNCHED: Variables! (Design Token support in Figma)

  • January 27, 2021
  • 110 replies
  • 31710 views

We have been managing our design system(s) for Desktop, Mobile, and TV applications in Figma for some time now and the experience overall has been great (especially with the updated Auto-Layout model) but one thing that has been extremely difficult to manage are design tokens. When I say manage I actually mean we are not using them because there is no solution to do so between Figma and our actual developer component libraries (Apple TV, iOS, Android Mobile, Android TV, HTML TV, HTML Desktop, etc…). We would love to more widely support themes in our apps and at a minimum use tokens for colors, spacing, font weights, and more. This would not only dramatically help with design speed and consistency but allow developers to more easily translate the components and layouts to real platform components (if you could inspect or export the tokens).

Here are a few key items that are quite difficult without first party support for tokens.

  • Color Themes: Without tokens you have to rely on color styles which have a few issues. One the alpha is part of the style so assigning a color style to an auto-layout background requires you to have a color for every alpha variation you may have (ie: modal overlays). We have written a plugin to replace theme colors with another theme but this is a bit of a hack and again can only replace the entire rgba set instead of just the color without affecting alpha. With design tokens and a few UI tweaks this would all go away.

  • Font Styles: Today, Type styles comprise font, weight, line-spacing, etc… which in general is great but if you want a bold, italic, or weight variation you have to create a style for every variant. This would be much more efficient with with tokens (ie. font-face-body, font-face-heading)

  • Spacing: While auto layout is amazing it would be so much better with paddings and gaps being able to be set via token. Today if you decide you want to change the standard gap between list items or card row items you will find yourself drilling down through a lot of components and manually updating pixel values. How much nicer would it be to change the spacing-s token and see everything update! I know some people use spacers but they just muddy design layers and with create so much complexity when auto-layout already supports individual paddings for T,R,B,L. The other issue here is that while you will have a component library the designs that use that library often use frame specific auto-layouts to compose them into the design. This means there is no downstream update to those designs if I want to change the standard margins on the left and right of our designs. Each and every frame (app view) has to be updated. For us that could be hundreds. If the tokens were part of the shared library (like styles) then designers would just use a spacing tokens downstream when laying out a page. This allows me to update the design system and as designers accept the changes in other files the spacing (margins) in this example would just update.

  • Developer handoff: By not having first party support for design tokens the only thing shown in in the inspect window for developers are styles and pixel values. It would be so nice if designers could export JSON and/or CSS variable code that defines the token model to provide developers (or let the developer download / copy them). Then in the inspect window the developer could see the tokens used for colors, padding, and so on.

I know there are plugins out there that attempt to help with this but they are just to fragile because the plugin system does not support modification of the actual Figma UI (which I think is a good thing). However, considering how important tokens are to modern UI design and component development, I feel like this may be something the Figma team is best suited to address.

Here are some quick and dirty mocks on implementation thoughts, based on the current UI. These are just meant to be thought starters so take it with a grain of salt. But I would love to hear what other think. Do others want this feature as well? Are you REALLY wishing we had design token support? Figma team, is there anything on the roadmap for something like this?

110 replies

Banta_Patrick
June 22, 2021

Adding my voice here. This has tremendous value for my org of 60+ some odd designers and many hundreds of engineers.

David_Fung
June 22, 2021

Has there been anything in any of the coffee chats or other social channels from Figma hinting and this? We’ve tried different plugins that have worked at times, but I prefer a first party solution. I would hate to think Figma to let Sketch win on the management of color styles.

raghavdesi9ns
June 26, 2021

I would wish I could vote for this topic twice, My company is finally coming around to component level thinking, this has been a major roadblock.

Delphine_Jaccone
June 30, 2021

+1
I’m an integrator, and it should be awesome for us to have this feature to see spacing-s instead of 8px

Billy_Stagg
July 26, 2021

I often find myself repeating the same numbers for certain attributes like border radius, stroke widths, animation time etc.

I also maintain Design Systems and although styles, effects and assets are great when accessing with the Figma API, other measurements feel a little more hacky, relying layer naming or other non-standard means to read values.

Could this be better:

I believe this explains it but I welcome any thoughts.

Jacob5
August 10, 2021

Hi there, I’m Design System Technical Leader and I have a question for Developers handoff.
Can we have those tokens inside CSS code in Figma?
in replacement of hex code have tokens name for example?
I didn’t see that maybe i’m wrong…
Other think, can we link that to Style Dictionary?
Thanks a lot

Erisvaldo_Junior
August 12, 2021

+1 on this, variables in Figma (instead of absolute values) for better supporting design tokens would be awesome

Christian_Petersen
August 15, 2021

For anyone interested, Specify is an app and API that aims to solve this across different applications and environments.

While it is still in early access, they are prioritizing teams as it is still under development.

The way it works is that it takes a connects a Source (Figma, Sketch, XD, etc.) and looks for tokens such as styles you’ve defined, but also specially named layers for things like Spacing and more. It presents this in the app with a list of all tokens in the document and are automatically kept in sync with your Figma file.

Developers can then use a JSON file to specify the format that they need the tokens in using several pre-made parsers which can be used to generate code in your desired format for the project (CSS/SCSS, Theme UI JSON, React components, you name it)—it also allows you to write your own parsers.

The company is also part of the W3C Design Tokens Community Group which aims to specify a standard for defining, delivering and communicating design tokens.

They had a roundtable in July, where several companies, including Figma were participating in talks about adopting this standard.

Hope this helps.

Ben_Wilson
New Participant
October 4, 2021

+1 on this. Nested styles and spacing would be huge for design systems.

The process becomes very painful, long and at risk of human error without the ability to nest colours and type styles into design tokens from an overarching “theme”.

Spacing tokens would be a huge game changer too. As would border radius. Having these as styles/variables would be massive for multi-brand design systems in order to be able to create differentiation per brand quickly and easily.

Spacing feels like a it would be a big undertaking but surely the concept of nested styles is something that wouldn’t be too difficult to implement. Please Figma!

Irwin_Sol
October 6, 2021

I’ve been waiting for Figma to implement a simple token reference for over 2 years. Even something like Semantic Color Sync by YNAB, but working with external libraries, would be a nice stop gap to a true token system.