Skip to main content
Freddy
New Participant
Jun 23, 2023 11:54 AM UTC
Solved

Best way to swap applied styles with variables

Hey, I’m stoked to see variables in Figma and immediately recreated our color style system as variables (the Styles-to-Variables-Converter Plugin worked like a charme).

So far so good, but how do I swap the applied styles with the new variables in my component libraries? Do I have to go through each page and swap them manually? Like so:

Is there a way to swap applied styles with variables for an entire file?

Any help is highly appreciated, thanks in advance!

This topic has been closed for replies.
ivan_guidea
ivan_guideaSolution
Mar 6, 2024 4:13 PM UTC

There is now the “Apply variables” plugin, which handles the styles to variables swap:

Figma

5 replies

mfelix
Figmate
Figmate
Jul 5, 2023 10:21 AM UTC

Hi @Freddy,

While a few plugins currently allow you to convert styles into variables, I can confirm you will have to manually assign these new variables to the right elements/layers if you want to fully swap them from styles to variables. There is currently no automatized way to do this (just yet).

Kevin_Simpson
New Member
Oct 11, 2023 6:41 PM UTC

I was able to change a Color Style to refer to the Variable, to change all instances of it in my design system. For example, in this image, I clicked on the canvas, edited the settings for my “Primary” color, clicked on the color box under Properties, clicked on the Libraries tab, then selected the variable (to replace the original hex code for that style).

I am just beginning this process, so I don’t know how robust this approach is yet, but for now it means that I only have to change all of the styles themselves (rather than instances of them across all pages).

Later I expect I’ll have to update the components themselves to refer to variables, but in the meantime this allows me to switch between themes (light, dark), etc.

ivan_guidea
ivan_guideaSolution
Mar 6, 2024 4:13 PM UTC

There is now the “Apply variables” plugin, which handles the styles to variables swap:

Figma
djv
Figmate
Community Support
Mar 7, 2024 5:39 PM UTC

Thanks for sharing, @ivan_guidea!

Apr 18, 2024 7:57 AM UTC

That is indeed a quick and effective solution. Thanks a lot for sharing.