Skip to main content

LAUNCHED: Bind color variables to gradients


Show first post
This topic has been closed for comments

66 replies

Zia.Irshad

+1 - I have a design system with multiple themes and each theme has a set of background of different color gradients. I’m not able to shift to variables from styles until we’ll have one single variable to handle a gradient. Which will allow me to quickly switch between themes.


Equinusocio

I solved this by creating variables for each gradient stop, so each theme has like a gradient-green-start and gradient-green-end


stevewang
  • 2 replies
  • January 9, 2024

but now they are saying typography is the next focus without mentioning anything about gradient at all: https://www.figma.com/blog/all-your-questions-about-variables-answered/


Mike_Fortuna

+1 for gradients and variable integration.


Pavel_Kiselev

I wouldn’t say it’s not feasible, for me it’s quite the opposite. In css each element has background-image prop which is like an extra layer you can put on top of the solid fill. So you can mix colors using alpha mask and get something like this

Other way around is to simple gradient as background image with a blend mode like overlay. I use white-to-black for deeper gradients, white-to-transparent or black-to-transparent to produce a variety of gradients.

It’s even more flexible and gives decent single color gradients

And here is another example made with Tailwind CSS

https://namad.github.io/source-foundation-docs/#gradients

I’m in huge favor of the latter as I can make nice gradient out of thin air.

Both ways are easy to componentise in Figma. Also it’s fairly easy to document so your devs won’t have troubles to get it done.

PS. Also I tried different blend modes in CSS. They are not exactly the same as in Figma, but good enough to have it in design work.

I got them in Figma, works just fine.


sho.ro
  • 5 replies
  • January 31, 2024

Great implementation! Our product team is primarily mobile-first, so we run into a lot of the native limitations of Android in rendering complex graphics, including issues with blend modes.

However, for the time being we are solving this by working closely with dev teams to implement our styles as intended in the code, and using opacity masks and blend modes to simulate the components on Figma.

(The other obvious solution was to reduce our 42 variations to just 6, haha)


Amanda_Bohlin1

+1 on this one!


Armas_Nurbahari

bump this! will like to see it in future release


neff
  • 5 replies
  • April 2, 2024

While gradients as variables would be nice, I’d rather have the option to put variables into gradients.
That way you wouldn’t need to change every possible gradient that include already existing colors.


Tiago_Gomes
  • 1 To the Topic 😃 Add it pls Figma 😃

Feef
  • 1 reply
  • April 23, 2024

+1 for gradient / variable integration. Real annoyance for us at the moment


  • 1 here. Figma, add gradient support to color variables.

Gyongy
  • 2 replies
  • April 24, 2024

Hi guys! This feature —binding color variables to gradients—was officially announced at Figma’s Framework 2024 event last week, along with support for typography variables. 🙂

You can find the playground file here: https://www.figma.com/community/file/1234936397107899445


dvaliao
Figmate
  • Community Support
  • 4690 replies
  • April 24, 2024

Hey All, @Gyongy is correct! We launched the ability to bind variables to gradients on April 16th! 🎉

You can now apply a color variable to the different gradient stops. And then, you can create a style for that gradient, which will then update across different modes.

twitter.com

dvaliao
Figmate
  • Community Support
  • 4690 replies
  • August 8, 2024

6 posts were merged into an existing topic: Add Gradients as a variable type


dvaliao
Figmate
  • Community Support
  • 4690 replies
  • November 27, 2024

4 posts were merged into an existing topic: Add Gradients as a variable type


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings