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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,40 @@ Selecting the First Supported Value: the ''first-valid()'' notation
12421242
<> imposes no contextual validity constraints on what it matches,
12431243
unlike <>.
12441244

1245+
1247+
1248+

1249+
Conditional Value Selection: the ''if()'' notation
1250+
1251+
The if() notation is an [=arbitrary substitution function=]
1252+
that represents conditional values.
1253+
Its argument consists of an ordered semi-colon–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+
1269+
<> = if( [ <> : <>? ; ]*
1270+
<> : <>? ;? )
1271+
<> =
1272+
supports( [ | ] ) |
1273+
media( <> ) |
1274+
style( <> ) |
1275+
else
1276+
1277+
1278+
ISSUE: Incorporate boolean syntax for combining these queries.
12451279

12461280
commit comments
Comments
 (0)