r/programming • u/yangzhou1993 • Jul 18 '21
5 Levels of Using CSS Variables
https://medium.com/techtofreedom/5-levels-of-using-css-variables-a4b01538279a
0
Upvotes
1
u/c-smile Jul 19 '21
In Sciter you can do
:root {
var(color): green;
}
div {
color: var(color);
}
@media screen and (max-width: 768px) {
:root {
var(color): red
}
}so that weird -- are not needed.
13
u/[deleted] Jul 18 '21
I feel like (4) misses the point of cascading style sheets:
Instead of redefining the rules, you should redefine the variable: