← Back to release summary
Optional descriptors for registered custom properties
- Category
- CSS
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
Allows authors to omit any descriptor in an @property rule and the corresponding optional members of CSS.registerProperty(). Omitted values default to universal syntax, inheritance, and the guaranteed-invalid initial value; invalid descriptors use normal CSS fallback behavior.
Motivation
Registered custom properties currently require authors to repeat syntax and inherits descriptors, and typed registrations cannot omit initial-value. The CSSWG resolved that registrations should behave like unregistered custom properties except for the descriptors authors explicitly provide. This removes boilerplate and lets typed properties use per-use var() fallbacks by defaulting initial-value to the guaranteed-invalid value.
Standards & signals
- Specification: https://drafts.css-houdini.org/css-properties-values-api-1/#at-property-rule
- Firefox: Positive — Mozilla recorded a positive position specifically for @property and also has a positive position for the overall CSS Properties and Values API:
- https://github.com/mozilla/standards-positions/issues/1090
The optional-descriptor change subsequently received CSSWG consensus:
- https://github.com/w3c/csswg-drafts/issues/13211#issuecomment-4040028009
- Safari: Support — WebKit recorded support for CSS Properties and Values API Level 1. The optional-descriptor change subsequently received CSSWG consensus:
- https://github.com/w3c/csswg-drafts/issues/13211#issuecomment-4040028009
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/issues/491802759
View on chromestatus.com