frontend-errors-cascade-conflicts
Installation
SKILL.md
Frontend Errors Cascade Conflicts
This skill diagnoses and fixes cascade conflicts in CSS : "why is my rule not winning". It assumes familiarity with @layer and @scope syntax (covered by [[frontend-syntax-css-cascade-layers-scope]]) and focuses on the decision tree, the inversions that surprise authors, and the DevTools workflow.
Sources : MDN: Specificity (verified 2026-05-19), MDN: Cascade (verified 2026-05-19), MDN: !important (verified 2026-05-19), MDN: @layer (verified 2026-05-19).
Quick Reference
Cascade sort order (FULL chain)
Apply these in order; the first DIFFERENCE decides the winner :
- Relevance. Filter to rules whose selector matches AND whose media context matches.
- Origin + Importance. See the 8-step ladder below.
- Layers. Layer order within the same origin + importance.
- Specificity. Higher wins.
- Scoping Proximity. For
@scoperules, the closest scope root wins. - Order of Appearance. Later declaration wins.