Skip to main content
Hampus_Svallfors
Jun 23, 2023 3:49 AM UTC
Question

How to use variables for shadows?

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
Dec 6, 2023 6:00 PM UTC
Jan 29, 2024 1:51 PM UTC

same here! following

joshmillgate
Feb 9, 2024 11:30 PM UTC

We need this 🙂

Feb 17, 2024 8:08 PM UTC

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
Feb 21, 2024 6:52 PM UTC

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:

Feb 21, 2024 7:08 PM UTC

Great point! Voted.

klint.holland
New Member
Dec 11, 2024 7:16 PM UTC

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.