Cascade Layers
Cascade layers are named groups that set the order of CSS rules. The browser checks this order before it compares selector specificity.
Another example
A site declares `@layer reset, tokens, components, utilities, overrides`. A low-weight utility can then beat a complex component selector because its layer comes later. Vendor CSS goes in the earliest layer, and a temporary override can be removed without leaving longer selectors behind.
Main parts
- 01Declared layer order
- 02Rules inside layers
- 03Unlayered boundary
Use it when
Set one shared layer order for resets, dependencies, components, utilities, and product overrides.
Do not use it when
Do not make a layer for every component. Also remember that normal unlayered author rules come after layered rules and can beat them.
Name used in code
@layer reset, base, components, utilities, overrides Before you ship
Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience.
Outcome: Use or define Cascade Layers to make the visual experience clear and easy to use. User context: A site declares `@layer reset, tokens, components, utilities, overrides`. A low-weight utility can then beat a complex component selector because its layer comes later. Vendor CSS goes in the earliest layer, and a temporary override can be removed without leaving longer selectors behind. Design concept to apply: Cascade Layers. Why it fits: Set one shared layer order for resets, dependencies, components, utilities, and product overrides. Do not use it when: Do not make a layer for every component. Also remember that normal unlayered author rules come after layered rules and can beat them. Design requirements: Set the content order, shared design values, and reusable components. Define how the layout changes by screen size and state. Keep useful design choices separate from decoration. Inclusion and resilience: Check contrast, zoom, languages, themes, and reduced motion when needed. Do not use color or effects as the only way to show meaning. Acceptance criteria: The design stays clear on phones and desktops, at zoom, in every theme, and in all supported languages. Interactive states stay clear and consistent. Evidence and limits (evidence boundary): A formal document may still be a draft, release candidate, or final version. Check its status and browser or platform support. Unknowns to confirm: Brand limits, amount of content, supported themes and languages, target devices, and design-system rules.
Check this request
Review the current use of Cascade Layers. Definition: Cascade layers are named groups that set the order of CSS rules. The browser checks this order before it compares selector specificity. Release checks: Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.