Skip to content

Commit 0eeca05

Browse files
committed
[css-properties-values-api] Move the @supports text from the JS API to the general section, replacing the note I had left in the general section.
1 parent fc12fed commit 0eeca05

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

css-properties-values-api/Overview.bs

+18-28
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,24 @@ which can start or interrupt a CSS transition.
293293
Conditional Rules {#conditional-rules}
294294
--------------------------------------
295295

296-
<div class=note>
297-
''@supports'' rules and the {{CSS/supports(conditionText)|CSS.supports()}} method
298-
behave as specified in [[!css-variables]],
299-
without distinguishing between registered and unregistered custom properties,
300-
and paying no attention to registered properties' syntaxes.
301-
</div>
296+
Unregistered custom properties are “always valid”
297+
when tested via ''@supports'';
298+
a rule like `@supports (--foo: red) {...}`
299+
is always true
300+
so long as you don't violate the (very liberal) syntax for custom properties.
301+
302+
Registering a custom property does not change this.
303+
Even if a custom property is, for example,
304+
registered with `syntax: "&lt;color>"`,
305+
a rule like `@supports (--foo: 1em) {...}`
306+
will still evaluate as true and apply those styles.
307+
308+
Note: This matches the [[#parsing-custom-properties|parsing behavior]] of registered custom properties.
309+
A registered custom property specified as `"&lt;color>"`
310+
but written as `--foo: 1em;` will still be accepted as valid at parse-time,
311+
but be automatically [=invalid at computed-value time=].
312+
As ''@supports'' tests parsing behavior,
313+
it thus also accepts all values as valid regardless of the registered syntax.
302314

303315
Relative URLs {#relative-urls}
304316
------------------------------
@@ -735,28 +747,6 @@ following members:
735747
:: The initial value of this custom property.
736748

737749

738-
Registered Properties and @supports {#supports}
739-
-----------------------------------------------
740-
741-
Unregistered custom properties are “always valid”
742-
when tested via ''@supports'';
743-
a rule like `@supports (--foo: red) {...}`
744-
is always true
745-
so long as you don't violate the (very liberal) syntax for custom properties.
746-
747-
Registering a custom property does not change this.
748-
Even if a custom property is, for example,
749-
registered with `syntax: "&lt;color>"`,
750-
a rule like `@supports (--foo: 1em) {...}`
751-
will still evaluate as true and apply those styles.
752-
753-
Note: This matches the parsing behavior of registered custom properties.
754-
A registered custom property specified as `"&lt;color>"`
755-
but written as `--foo: 1em;` will still be accepted as valid at parse-time,
756-
but be automatically [=invalid at computed-value time=].
757-
As ''@supports'' tests parse behavior,
758-
it thus also accepts all values as valid regardless of the registered syntax.
759-
760750
Dependency Cycles Via Relative Units {#dependency-cycles}
761751
---------------------------------------------------------
762752

0 commit comments

Comments
 (0)