Skip to main content
Question

Variable aliases to have different values on different modes

  • June 26, 2024
  • 1 reply
  • 83 views

sanjuatwork

I agree this is possible to have different values on different modes. I mean technically it works.
I have two collections primitive colors and semantic colors which refers to the former. There are some scenarios where I want to have white in Light Mode which can have different colors based on context. For example, card background can be white in Light, Dark mode will obviously have shade of black in primitive, but I want a different color for card background alone in Dark mode.
I can change the color in the dark mode in the semantic collection but it doesnโ€™t seem to work though.

Ideas and help appreciated.

1 reply

Pavel_Kiselev

The way to do it is via your semantic tokens. Define multiple card surfaces instead, say primary/secondary, lowered/raised and so on


Reply


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