Skip to main content
Question

Variable aliases to have different values on different modes

  • June 26, 2024
  • 1 reply
  • 130 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.

This topic has been closed for replies.

1 reply

Pavel_Kiselev
  • Power Member
  • 438 replies
  • June 26, 2024

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