DRY Switching with CSS Variables: The Difference of One Declaration

This is the first post of a two-part series that looks into the way CSS variables can be used to make the code for complex layouts and interactions less difficult to write and a lot easier to maintain. This first installment walks through various use cases where this technique applies. The second post (coming tomorrow!) will cover the use of fallbacks and invalid values to extend the technique to non-numeric values.
What if I told you a single …
The post DRY Switching with CSS Variables: The Difference of One Declaration appeared first on CSS-Tricks.

Link: https://css-tricks.com/dry-switching-with-css-variables-the-difference-of-one-declaration/