The cascade in CSS is like inheritance in Object-Oriented programming
The cascade in CSS is like inheritance in Object-Oriented programming.
It sounds like a good idea at first, but it often causes more problems than it solves.
Inheritance in OO leads to brittle hierarchies that are risky to change and hard to understand.
The CSS cascade leads to the same problems.
"Prefer composition over inheritance"
We've heard this wisdom in OO circles for years.
This rule applies to CSS too. In CSS, inheritance is accomplished via the cascade.
Utility classes avoid inheritance by *composing* utility classes. 👍