Skip to main content
Hampus_Svallfors
June 23, 2023
Question

How to use variables for shadows?

  • June 23, 2023
  • 17 replies
  • 11952 views

Hi, I would like to set the color of my shadows with a color variable. I know this isn’t possible with color styles, but does anyone know if it’s now possible now somehow? Hack is ok 😅

Otherwise, I feel having the same component between different variable modes would look strange because the shadow color would have to be the same for all modes, right?

Thanks

This topic has been closed for replies.

17 replies

Hampus_Svallfors
December 6, 2023
January 29, 2024

same here! following

joshmillgate
February 9, 2024

We need this 🙂

February 17, 2024

It looks like it’s been added to Figma.

To test it, I made my variables and created two modes: dark-mode and light-mode.

I set my desired shadows for light and dark under the ‘drop-shadow-opacity’ variable. Because I can’t give the drop shadow effect a boolean variable, I gave the light-mode a 0% colour opacity.

Then, once you’ve added your drop shadow to the frame, open the details and click the colour box.

From there, you can select the colour variable from your library. You can see it applied in the photo. I’d upload more photos, but new users can only upload one image.

Hopefully, that works for all of your needs, it’s been working for me!

Hampus_Svallfors
February 21, 2024

That is great Ryan! 🎉

For context, the existing method works if you don’t have a multi-layer token system. Such as one layer for your primary color Palette and one layer for your Semantic colors. When you use multiple layers, you never want to ‘hard code’ values like this on a semantic or theme token, but instead reference another more primitive token. Multi-layer systems are very popular, and (more or less) crucial if you have design systems with multiple themes, modes or brands.

But you are right that this ticket is pretty much done. What we are waiting for is variables with alpha included 🙂 Go and vote on it if you haven’t already:

February 21, 2024

Great point! Voted.

klint.holland
New Member
December 11, 2024

A year and a half later and we’re all still waiting for more functionality with variables like drop shadows and typography. But thank goodness we have Figma Slides (which no one asked for). Figma keeping Tokens Studio in business.