3 ms·
css variables now make consistency fairly easy to support, since you can just define root level variables that change depending on light/dark-mode, etc.
by bobthepanda 2y ago
css variables now make consistency fairly easy to support, since you can just define root level variables that change depending on light/dark-mode, etc.
- recursive 2y agoThis only works if your team is disciplined enough to make it work. It's always easier to reach for `4px` than remembering the variable name of the standard button margin. But this is the basic paradigm I try to use most of the time too.
- bobthepanda 2y agoIf your editor of choice has autocomplete it is the same or less work than using named standard classes in a framework like bootstrap.
- recursive 2y agoMy editor has autocomplete as a general feature. I've never seen one that was aware of css variable names across files though.
- lelanthran 2y ago> My editor has autocomplete as a general feature. I've never seen one that was aware of css variable names across files though. I'm using vscode with codeium. It autocompletes variables[1] across files. [1] And almost everything else.
- bobthepanda 2y agoI use intellij and it is css-variable aware but not css class aware.
- alwillis 2y agoIt's even easier using the light-dark() function [1]. [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/light-dark https://developer.mozilla.org/en-US/docs/Web/CSS/color_value...