From Figma to code: Using zeroheight’s design tokens manager

Nefertiti Dukes
Written by Nefertiti Dukes
Jul 26, 2024

A bit more than a year ago, we introduced our design tokens manager. The feature set allows folks to import tokens, edit them with no code, and distribute them to be consumed by other tools or your code base.

Since the feature was unveiled, a lot has been improved. For example, folks can now:

  • Import and export tokens to GitLab
  • Import and export tokens to Bitbucket
  • Import tokens from Figma variables using our plugin
  • Export tokens to Style Dictionary

Our latest update, available today, might be the most exciting, though. Now, tokens created from Figma variables can be exported to Style Dictionary.

This is huge! It means that designers can create variables in Figma and deliver them to your product’s code base, whether it's built for iOS, React, JavaScript, SCSS, or plain CSS.

Using Figma variables in a design system

Since variables were announced at Config 2023, Figma’s done some expanding of their own. Today, design system teams can leverage color, boolean, number, and string variables.

With access to more variable types, teams can define all of the core tokens of their product (or their product’s DNA). A variable could define the correct brand color, the right font type and size, or even shadow effects. Once variables are defined, changing them down the line is spectacularly easy, making it possible for teams to create and maintain a consistent product with minimal tech debt.

While variables are incredibly powerful when used correctly, they do require documentation, which is where a documentation site, like zeroheight, comes in.

Team members need to know when they should use the brand color or when they need to use the primary font vs. the secondary font. And you can document all of that in a zeroheight styleguide.

It starts with using our plugin to bring in Figma variables. From there, you can mention variables on any page. For example, you can write naturally to say things like:

Or, you may decide to show your variables in a table that allows your styleguide viewers to quickly scan through tokens and their values.

The @color-ui-negative should be used to convey disappointing information to users, like a flight delay.

Regardless of how you choose to document your variables, ensuring every member of the product team knows how to appropriately leverage them is key to realizing their value.

How to get Figma variables into code

Documenting variables is important, but how do we get them from design to code?

Luckily, that’s covered by our design tokens manager, too!

Once a variable is imported into zeroheight as a token, you can export it. Our Style Dictionary export options allow you to export your variables to Amazon’s Style Dictionary format as well as many of the most popular languages, including CSS, Android, JavaScript, JSON, and iOS.

Choosing any of those options yields a URL that can be placed directly into your project.

The real magic happens when you need to change a variable value, though. With the URL already in a project, a designer can update a variable value in Figma, push that change over to zeroheight with the plugin, and then push changes that show up immediately in your product.

Finally, there’s a way for designers to update variables and have those reflected in code seamlessly.

Bringing variables to your codebase

For some folks, the idea of pushing a button in zeroheight to create a change in your product is uber-scary, and I can certainly see why. However, a design system team that regularly engages in discussions around variable changes should be able to avoid any mishaps. And the benefits of keeping variables in Figma in sync with your codebase are exponential.

I’m hoping you'll give getting your Figma variables out of Figma and into your codebase a try. When you do, I’m excited to hear about how the process has lessened tech debt and brought design and code closer together (because I’m certain it will).

The super cool part about this update is that it’s available on our Free plan, allowing every team using zeroheight to take advantage of it. And if you’re not using zeroheight just yet, you can give our design tokens manager a try without using any of our documentation tools (sign up free).

Nefertiti Dukes
Nefertiti Dukes
Try zeroheight
The design systems platform that keeps teams and agents in sync
Start for free
Share this post