demo · v136

Registered property rescue

The real-world pattern this unblocks: a registered custom property declared with one type, but a fallback expression that resolves to another type at use-site. Pre-136 the fallback was rejected if its type didn't match the registration. 136+ accepts any syntactically valid fallback — the resolved value still has to match the consumer's expectation, of course.

Probing…

The registered property --brand is declared as <color>. We try referencing it in a context that expects background-image using a gradient fallback.

fallback used (registration not present)

.s { background: var(--brand, linear-gradient(45deg, red, blue)); }

value used (registration provides color)

@property --brand { syntax: '<color>'; inherits: true; initial-value: rebeccapurple; } .s { background: var(--brand, linear-gradient(45deg, red, blue)); }
CSS.registerProperty success
computed --brand

why this angle

The sibling concept demonstrates the parsing rule change. This concept demonstrates the real-world reason the change shipped: design-token systems that declare typed properties but want richer fallbacks (gradients, images, calc that returns a different category) without those fallbacks being silently dropped.

see also