Cascade layersBaseline · Widely available
The @layer CSS at-rule avoids specificity conflicts by providing priority levels for different groups of CSS rules, such as low-priority styles like resets, and high-priority styles like UI components.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Mar 14, 2022. Widely available since Sep 14, 2024.
Browser support
DesktopChrome
1–98Not supported
99+Supportedsince Mar 1, 2022
Current: 155Edge
12–98Not supported
99+Supportedsince Mar 3, 2022
Current: 154Firefox
1–96Not supported
97+Supportedsince Feb 8, 2022
Current: 157Safari
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27MobileChrome Android
18–98Not supported
99+Supportedsince Mar 1, 2022
Current: 155Firefox Android
4–96Not supported
97+Supportedsince Feb 8, 2022
Current: 157Safari iOS
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
CSS
@layer reset, base, components, utilities;
@layer base {
a { color: steelblue; }
}
@layer utilities {
.text-red { color: red; } /* wins over earlier layers */
}Feature detection
JS · check before using
if ("CSSLayerBlockRule" in globalThis) {
// CSSLayerBlockRule is available
} else {
// load a polyfill or use a fallback
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (8). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| CSSImportRule.layerName | 99 | 99 | 97 | 15.4 | 99 | 97 | 15.4 |
| CSSLayerBlockRule | 99 | 99 | 97 | 15.4 | 99 | 97 | 15.4 |
| CSSLayerBlockRule.name | 99 | 99 | 97 | 15.4 | 99 | 97 | 15.4 |
| CSSLayerStatementRule | 99 | 99 | 97 | 15.4 | 99 | 97 | 15.4 |
| CSSLayerStatementRule.nameList | 99 | 99 | 97 | 15.4 | 99 | 97 | 15.4 |
| @import.layer | 99 | 99 | 97 | 15.4 | 99 | 97 | 15.4 |
| @layer | 99 | 99 | 97 | 15.4 | 99 | 97 | 15.4 |
| <global_keywords>.revert-layer | 99 | 99 | 97 | 15.4 | 99 | 97 | 15.4 |