Cascade
The algorithm deciding which declaration wins when several apply to the same element.
The cascade is CSS's conflict-resolution algorithm. When multiple declarations target the same property on the same element, the winner is chosen by, in order: origin and importance, cascade layer, specificity, and finally document order.
Specificity is the part most people internalise — a count of identifiers, classes, and element names in the selector, compared component-wise so that no number of class selectors ever beats a single identifier selector. It is why specificity wars escalate: the reliable way to win is to be more specific, and the result is a stylesheet where nothing can be overridden without escalating further.
Modern CSS provides better tools. Cascade layers let you declare precedence explicitly, independent of specificity, so a design system's rules can be authored at low specificity and still lose to consumer overrides on purpose. Utility-first approaches sidestep the problem by keeping every rule at the same low specificity; see Utility-First CSS.
Understanding the cascade also explains a class of cross-application bugs: styles from one application's administrative interface leaking into another's front end and pinning a root-level property, breaking an inherited background further down. The symptom appears at the leaf; the cause is a declaration that won at the root.
See also4
Hand-picked in the note itself — the neighbours worth reading next.
CSS Custom Property
A user-defined CSS property that participates in the cascade and inherits down the tree.
Design & Interface9 connections
Scoped Styling
Confining a set of style decisions to a subtree so the same component can look different in different contexts.
Design & Interface9 connections
Utility-First CSS
Composing styles from many small single-purpose classes rather than authoring semantic rules.
Design & Interface11 connections
Root Cause Analysis
Escalating past the visible symptom until you find the layer that actually produced it.
Method21 connections
Related5
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from5
Notes elsewhere in the wiki that reach for this one.
- CSS Custom PropertyDesign & Interface
A user-defined CSS property that participates in the cascade and inherits down the tree.
- Design TokenDesign & Interface
Named design decisions — colour, spacing, radius, type — stored as data so they can be shared and re-themed.
- OKLCHDesign & Interface
A perceptually uniform colour space that makes lightness and chroma behave predictably.
- Scoped StylingDesign & Interface
Confining a set of style decisions to a subtree so the same component can look different in different contexts.
- Utility-First CSSDesign & Interface
Composing styles from many small single-purpose classes rather than authoring semantic rules.