Skip to content

Commit 40581b7

Browse files
committed
[css-properties-values-api] Specify how registered properties work in @supports. Fixes #118.
1 parent 086aebf commit 40581b7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

css-properties-values-api/Overview.bs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,31 @@ matches to the specified value.
401401
For list values, the computed value is a list of the computed values of the
402402
primitives in the list.
403403

404+
405+
Registered Properties and @supports {#supports}
406+
-----------------------------------------------
407+
408+
Unregistered custom properties are “always valid”
409+
when tested via ''@supports'';
410+
a rule like `@supports (--foo: red) {...}`
411+
is always true
412+
so long as you don't violate the (very liberal) syntax for custom properties.
413+
414+
Registering a custom property does not change this.
415+
Even if a custom property is, for example,
416+
registered with `syntax: ""`,
417+
a rule like `@supports (--foo: 1em) {...}`
418+
will still evaluate as true and apply those styles.
419+
420+
Note: This matches the parsing behavior of registered custom properties.
421+
A registered custom property specified as `""`
422+
but written as `--foo: 1em;` will still be accepted as valid at parse-time,
423+
but be automatically [=invalid at computed-value time=].
424+
As ''@supports'' tests parse behavior,
425+
it thus also accepts all values as valid regardless of the registered syntax.
426+
427+
428+
404429
Behavior of Custom Properties {#behavior-of-custom-properties}
405430
==============================================================
406431

0 commit comments

Comments
 (0)