You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-values/Overview.bs
+37Lines changed: 37 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -233,6 +233,43 @@ Component value multipliers</h3>
233
233
If a property value contains more than the supported number of repetitions,
234
234
the declaration must be ignored as if it were invalid.
235
235
236
+
<h3 id='combinator-multiplier-patterns'>
237
+
Combinator and Multiplier Patterns</h3>
238
+
239
+
There are a small set of common ways to combine multiple independent <a>component values</a> in particular numbers and orders.
240
+
In particular, it's common to want to express that,
241
+
from a set of component value,
242
+
the author must select zero or more, one or more, or all of them,
243
+
and in either the order specified in the grammar or in any order.
244
+
245
+
All of these can be easily expressed using simple patterns of <a href="#component-combinators">combinators</a> and <a href="#component-multipliers">multipliers</a>:
246
+
247
+
<table class='data'>
248
+
<thead>
249
+
<tr>
250
+
<th>
251
+
<th>in order
252
+
<th>any order
253
+
<tbody>
254
+
<tr>
255
+
<th>zero or more
256
+
<td><pre>A? B? C?</pre>
257
+
<td><pre> A? || B? || C?</pre>
258
+
259
+
<tr>
260
+
<th>one or more
261
+
<td><pre>[ A? B? C? ]!</pre>
262
+
<td><pre>A || B || C</pre>
263
+
264
+
<tr>
265
+
<th>all
266
+
<td><pre>A B C </pre>
267
+
<td><pre>A && B && C</pre>
268
+
</table>
269
+
270
+
Note that all of the "any order" possibilities are expressed using combinators,
271
+
while the "in order" possibilities are all variants on juxtaposition.
Combinator and Multiplier Patterns</span><aclass=self-linkhref=#combinator-multiplier-patterns></a></h3>
394
+
395
+
<p>There are a small set of common ways to combine multiple independent <adata-link-type=dfnhref=http://dev.w3.org/csswg/css-syntax-3/#component-valuetitle="component values">component values</a> in particular numbers and orders.
396
+
In particular, it’s common to want to express that,
397
+
from a set of component value,
398
+
the author must select zero or more, one or more, or all of them,
399
+
and in either the order specified in the grammar or in any order.</p>
400
+
401
+
<p>All of these can be easily expressed using simple patterns of <ahref=#component-combinators>combinators</a> and <ahref=#component-multipliers>multipliers</a>:</p>
402
+
403
+
<tableclass=data>
404
+
<thead>
405
+
<tr>
406
+
<th>
407
+
<th>in order
408
+
<th>any order
409
+
<tbody>
410
+
<tr>
411
+
<th>zero or more
412
+
<td><pre>A? B? C?</pre>
413
+
<td><pre> A? || B? || C?</pre>
414
+
415
+
<tr>
416
+
<th>one or more
417
+
<td><pre> [ A? B? C? ]!</pre>
418
+
<td><pre>A || B || C</pre>
419
+
420
+
<tr>
421
+
<th>all
422
+
<td><pre>A B C </pre>
423
+
<td><pre>A && B && C</pre>
424
+
</table>
425
+
426
+
<p>Note that all of the "any order" possibilities are expressed using combinators,
427
+
while the "in order" possibilities are all variants on juxtaposition.</p>
In this case, a space would be required before the <spanclass=cssdata-link-type=maybetitle=2>2</span>
406
444
to get this parsed as the two lengths <spanclass=cssdata-link-type=maybetitle=1em>1em</span>and <spanclass=cssdata-link-type=maybetitle=2em>2em</span>.</p>
0 commit comments