How should I go about making these components for dark mode and light mode?
switchman8850
1 year ago
As you can see in the screenshot, I have a single component that can have multiple light styles and multiple dark styles. What is best practice on how to make these different styles for light and dark?
gazinhio
1 year ago
There are a few ways you can do it. I tend to use Style variables as they enable you to use a formula to determine colours or you can use style classes. A lot depends on how you're passing in the status of the theme dark or light eg through a component attribute or through context.
switchman8850
1 year ago
Do you have an example of how I could use style variables? The challenge with this, it seems, is that if I were to use classes, I would need essentially a light-green, dark-green, light-red, and dark-red, no?