A Structured Approach to Custom Properties
July 25, 2024
If you’re anything like me, you’ve probably tried a handful of different approaches to organizing your custom properties. Most approaches I’ve used have been adequate, but I rarely feel completely satisfied with them. I spent far too long flailing about trying to find what worked. I should have looked sooner to the realm of design tokens. I think some common standards when building a design system are useful when applied directly to CSS custom properties.
At least at first when we use CSS custom properties were likely to use them relatively naively–as replacements for values in our CSS itself. But there re other, more powerful ways of thinking about CSS properties, like this from Keith J Grant.