Skip to content

Commit 7716c99

Browse files
committed
[css-mixins-1] Put a type on @env, in anticipation of it being testable/etc.
1 parent 216d441 commit 7716c99

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

css-mixins-1/Overview.bs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,16 +1421,26 @@ in any other context it's invalid and ignored.
14211421
Its grammar is:
14221422

14231423
<pre class=prod>
1424-
<<@env>> = @env <<custom-property-name>> : <<declaration-value>>? ;
1424+
<<@env>> = @env <<custom-property-name>> <<css-type>>? : <<declaration-value>>? ;
14251425
</pre>
14261426

14271427
This defines a [=scoped environment variable=]
14281428
with a name given by the <<custom-property-name>>,
1429+
optionally a type given by <<css-type>>,
14291430
and a value given by the <css><<declaration-value>>?</css>.
14301431
Its scope is the rule it's nested in,
14311432
or the stylesheet it's defined in
14321433
if it's not nested.
14331434

1435+
If a <<css-type>> is given,
1436+
then when an ''env()'' referencing this [=scoped environment variable=]
1437+
is [=replace an arbitrary substitution function|replaced=],
1438+
the value must [=CSS/parse=] according to the <<css-type>>,
1439+
or else the ''env()'' is replaced by the [=guaranteed-invalid value=].
1440+
If it successfully parses,
1441+
the value has the specified type.
1442+
1443+
14341444
<h4 id=using-scoped-env>
14351445
Using Scoped Environment Variables</h4>
14361446

0 commit comments

Comments
 (0)