Warning: containment breach in cascade layer!
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
CSS cascade layers are supposed to solve specificity wars, but they have surprising edge cases. Using custom property fallback values is an effective escape hatch when a utility layer class needs to be overridden by a component layer. More surprisingly, !important declarations in lower cascade layers actually breach containment and override higher layers — with the lowest layer's !important winning — which feels counterintuitive and causes real problems in messy ecosystems like WordPress where plugins rely on !important.
Sort: