Design system colors (light/dark mode) #16
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add the design system colors to the codebase, as reusable variables or similar. Make sure that the solution works for both light and dark mode. This could be made using an "alias" - one variable that point to different colors depending on light/dark mode.
Resources
Color aliases
Design system colors and dark modeto Design system colors (light/dark mode)Updated Figma resource @stne3960.
If the current naming system using aliases is not compatible with tailwind, maybe a solution could be to make independent variables for dark/light mode by adding a "-light" or "-dark" suffix.
For example,
Primarywould be split up intoprimary-lightandprimary-dark.Just a thought, maybe there is a better solution
@jare2473
I think I've found a viable solution to this. By defining the colors to the main css like this
We can define a button like this
@stne3960 Alright! This is similar to what I did in my prototype. So you could maybe add a layer to yours and get the same structure, with base colors and aliases. Here is a short example:
We could add an additional layer. Could you elaborate on what the benefits of that would be?
This code would map directly to the color aliases linked in this issue which also map to the colors defined for buttons in issue #15
My impression is that it seems to be a bit of "best practice". Also for me it makes sense to first define the colors themselves, and then "combine" them into an alias. And as for now, this is how I have the colors set up in Figma, so it would map to that as well.
But feel free to implement this the way that feels best to you