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

Costas
New Participant
February 15, 2021

Sorry for the delay @Evan_MacAlpine ! I didn’t notice the tracking feature. Anyways, the plugin is “Toolabs Design System Manager” Figma - Toolabs Design System Manager | ✦ Design Tokens, Theme Management and more... Define or update design tokens in one single panel...

Evan_MacAlpine
New Participant
February 16, 2021

No prob @Costas. Thanks for the update! I’ve seen that tool but haven’t tried it yet. Is it working well for you? Are you using it in production? Seems like it would tick a lot of our boxes. Also, @Jason_Williams, just pinging you because I think you were interested as well…

Costas
New Participant
February 16, 2021

@Evan_MacAlpine , yes, I’m using it these days on a new project and I have to say that it works well.

  • To get the most out of it, one must understand the ‘breakpoints/devices/themes’ concept - which was a little bit confusing for me, but once I got it it turned as a time savior. As a result, it allows you to have multiple sets of tokens related to the breakpoints you wish.
  • Other cool feature is the way this plugin handles main colors, contrast ratio and shades/tints.
  • Everything you do in the figma’s plugin are reflected on the web-app in real time and vice-versa.
  • The design documents you create are shareable. You can apply them in separate files
  • The web-app creates an editable design document out-of-the-box with export options
Evan_MacAlpine
New Participant
February 16, 2021

🙌 Thanks a lot for the info @Costas! That’s super helpful. Always nice to hear how a product is working in the “wild”. I think I’ll try to check it out this week and see how it works for our setup.

Edward_Wang
February 27, 2021

Here at Twitter we’ve started using Design Tokens and one big piece is just handoff communication. We’d love to just have the name of the token be retained like colors but for others as well. Say Corner Radius, Border Width, Spacers.

I think some support could go a long way, the Figma plugin community can help with gaps. It’s just that I wish design tokens were native/first class citizens in figma.

danny.brown
March 29, 2021

It looks like Figma may have taken part in the recent “Design Tokens Community Group” vendor roundtable meeting? I’m hopeful with competition starting to add first class support for design tokens, and standardization looking possible, that we’ll see something before too terribly long make it’s way into Figma 🤞

Community Page: Design Tokens Community Group

Dennis1
March 29, 2021

I want to have a way to set different values (like color) through property values. By adding an input field that lets you set variables, you’re making this possible. There won’t be any need for billions of components for any color you can think of. You could also make variables set to text (good for pseudo usernames!)

This is a quick mockup I made showing how this could work, maybe add a color picker?
image

What do you think? Would this help you? I know it would help me 😛

Jc_Martel
March 29, 2021

Hi @Dennis1 , by using components with variants, you can easily achieve this right now in Figma. If you prefer, there are also multiple plugins to achieve a similar goal such as Color Theme Manager and Themer.

I hope this helps!

Dennis1
March 30, 2021

I know variats are a thing 😛
But sometimes I want variable colors and stuff, something like Unity, where you can just drag (e.g) an icon onto the input box and itll use that

I wouldn’t really want to create a new component for each possible combination 😅

Yamero
New Member
March 31, 2021

When I set the text properties, fields, baseline grid and so on, I have to write these values down, keep track of them, copy from one property to another, multiply, divide them and I do all that manually.

I propose to set variables right in the value fields. It would make saving and using numbers and simple formulas for building the ‘system design’ more convenient.