Skip to content

Commit 5a6b912

Browse files
committed
[css-variables] Allow var(--a,) to be valid. Fixes w3c#6345
1 parent fa09fd5 commit 5a6b912

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

css-variables-1/Overview.bs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,16 @@ Using Cascading Variables: the ''var()'' notation</h2>
425425
<dfn>var()</dfn> = var( <<custom-property-name>> , <<declaration-value>>? )
426426
</pre>
427427

428+
In an exception to the usual <a grammar lt=,>comma elision rules</a>,
429+
which require commas to be omitted when they're not separating values,
430+
a bare comma, with nothing following it,
431+
must be treated as valid in ''var()'',
432+
indicating an empty fallback value.
433+
434+
Note: That is, ''var(--a,)'' is a valid function,
435+
specifying that if the ''--a'' custom property is invalid or missing,
436+
the ''var()'' should be replaced with nothing.
437+
428438
The ''var()'' function can be used in place of any part of a value in any property on an element.
429439
The ''var()'' function can not be used as
430440
property names,
@@ -604,7 +614,7 @@ Invalid Variables</h3>
604614

605615
: The property is a non-registered [=custom property=]
606616
: The property is a [=registered custom property=]
607-
with [=univerisal syntax definition|universal syntax=]
617+
with [=universal syntax definition|universal syntax=]
608618
:: The computed value is the <a>guaranteed-invalid value</a>.
609619

610620
: Otherwise

0 commit comments

Comments
 (0)