Skip to main content
Stanislav_Knopp
Jul 17, 2023 11:11 AM UTC
Solved

Disable shadow in Dark mode with variables

I have card components which use smadows in Light mode, but can I disable them in Dark mode using Variables? Can’t figure it out. Thanks 🙂

This topic has been closed for replies.
Edwart
EdwartSolution
Jul 17, 2023 12:58 PM UTC

Hi @Stanislav_Knopp,

As Harrol mentioned it is not possible directly, but you can work with boolean properties for variants in combination with boolean variables per mode. Added screenshot for explanation.

5 replies

Haroll
Figma Ambassador
Figma Ambassador
Jul 17, 2023 12:04 PM UTC

Hi @Stanislav_Knopp

I don’t think it’s possible at the moment, but Figma plans to add support for variables in other places soon (some are described on the link bellow). You might need to wait a little bit

Figma Help Center
Figma’s Forum Ambassador
Edwart
EdwartSolution
Jul 17, 2023 12:58 PM UTC

Hi @Stanislav_Knopp,

As Harrol mentioned it is not possible directly, but you can work with boolean properties for variants in combination with boolean variables per mode. Added screenshot for explanation.

Stanislav_Knopp
Jul 18, 2023 8:17 AM UTC

@Edwart Thank you very much 🙂

Trevor_Dupp
Jul 24, 2023 4:16 AM UTC

Great solution, unfortunately if you try to nest an instance of that card into another component that relationship gets stripped out.

As long as you don’t nest it - that solution will work 🙂

Emir3
Nov 28, 2024 1:41 PM UTC

Maybe this is outdated, but there is what I did.

I have used this method with variables to solve it the light/dark mode. So far it works really well.