Skip to content

Commit f70deb4

Browse files
committed
[css-values-5] Define if() notation #10064 #5624 #5009 #6638 #4731 #3455
1 parent d904ce9 commit f70deb4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

css-values-5/Overview.bs

+34
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,40 @@ Selecting the First Supported Value: the ''first-valid()'' notation</h3>
12421242
<<declaration-value>> imposes no contextual validity constraints on what it matches,
12431243
unlike <<whole-value>>.
12441244

1245+
<!-- Big Text: if()
1246+
-->
1247+
1248+
<h3 id="if-notation">
1249+
Conditional Value Selection: the ''if()'' notation</h3>
1250+
1251+
The <dfn>if()</dfn> notation is an [=arbitrary substitution function=]
1252+
that represents conditional values.
1253+
Its argument consists of an ordered semi-colon&ndash;separated list of statements,
1254+
each consisting of a condition
1255+
followed by a colon
1256+
followed by the value represented by this notation
1257+
if the corresponding condition is the first in the list to be true.
1258+
If no condition matches,
1259+
then the ''if()'' notation represents an empty token stream.
1260+
1261+
Note: [=Arbitrary substitution functions=] all resolve at [=computed value=] time;
1262+
therefore if the resulting property value is invalid,
1263+
it falls back to the property's [=initial value=]
1264+
rather than to an earlier value in the [=cascade=].
1265+
1266+
The ''if()'' notation syntax is defined as follows:
1267+
1268+
<pre class=prod>
1269+
<dfn><<if()>></dfn> = if( [ <<if-condition>> : <<declaration-value>>? ; ]*
1270+
<<if-condition>> : <<declaration-value>>? ;? )
1271+
<dfn><<if-condition>></dfn> =
1272+
supports( [ <supports-condition> | <declaration> ] ) |
1273+
media( <<media-query>> ) |
1274+
style( <<style-query>> ) |
1275+
else
1276+
</pre>
1277+
1278+
ISSUE: Incorporate boolean syntax for combining these queries.
12451279

12461280
<!-- Big Text: toggle()
12471281

0 commit comments

Comments
 (0)