Registered custom propertiesBaseline · Newly available
The CSS.registerProperty() static method and the @property CSS at-rule register custom properties for which types and behaviors can be defined.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Jul 9, 2024.
Browser support
DesktopChrome
1–84Not supported
85+Supportedsince Aug 25, 2020
Current: 155Edge
12–84Not supported
85+Supportedsince Aug 27, 2020
Current: 154Firefox
1–127Not supported
128+Supportedsince Jul 9, 2024
Current: 157Safari
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27MobileChrome Android
18–84Not supported
85+Supportedsince Aug 25, 2020
Current: 155Firefox Android
4–127Not supported
128+Supportedsince Jul 9, 2024
Current: 157Safari iOS
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27How to use
Every current browser supports this, but it only became Baseline on Jul 9, 2024. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN: registerProperty static.
Feature detection
JS · check before using
if ("CSSPropertyRule" in globalThis) {
// CSSPropertyRule is available
} else {
// load a polyfill or use a fallback
}Sub-features
Support for each part of the feature (10). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| CSS.registerProperty_static | 78 | 79 | 128 | 16.4 | 78 | 128 | 16.4 |
| CSSPropertyRule | 85 | 85 | 128 | 16.4 | 85 | 128 | 16.4 |
| CSSPropertyRule.inherits | 85 | 85 | 128 | 16.4 | 85 | 128 | 16.4 |
| CSSPropertyRule.initialValue | 85 | 85 | 128 | 16.4 | 85 | 128 | 16.4 |
| CSSPropertyRule.name | 85 | 85 | 128 | 16.4 | 85 | 128 | 16.4 |
| CSSPropertyRule.syntax | 85 | 85 | 128 | 16.4 | 85 | 128 | 16.4 |
| @property | 85 | 85 | 128 | 16.4 | 85 | 128 | 16.4 |
| @property.inherits | 85 | 85 | 128 | 16.4 | 85 | 128 | 16.4 |
| @property.initial-value | 85 | 85 | 128 | 16.4 | 85 | 128 | 16.4 |
| @property.syntax | 85 | 85 | 128 | 16.4 | 85 | 128 | 16.4 |