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
<p>This CSS3 module describes the various values and units that CSS
@@ -227,8 +298,10 @@ <h3>Functional notation</h3>
227
298
(',') with optional whitespace before and after the comma.
228
299
229
300
<divclass="example">
301
+
<pre>
230
302
background: url(http://www.example.org/image);
231
303
color: rgb(100, 200, 50 );
304
+
</pre>
232
305
</div>
233
306
234
307
<p>Some properties accept space- or comma-separated lists of values. A value
@@ -237,6 +310,47 @@ <h3>Functional notation</h3>
237
310
value is a <dfn>simple value</dfn>.
238
311
239
312
313
+
<h3>Cycle function</h3>
314
+
315
+
<p>The cycle() expression allows descendant elements to cycle over a list
316
+
of values instead of inheriting the same value. The syntax of the
317
+
cycle() expression is:
318
+
319
+
<pre>
320
+
cycle( <value> [, <value> ]*)
321
+
</pre>
322
+
323
+
where <value> is a CSS value that is valid where the expression is
324
+
placed. If any of the values inside are not valid, then the entire
325
+
cycle() expression is invalid.
326
+
327
+
<p>The value returned by cycle() must be determined by comparing the
328
+
inherited value I (the computed value on the parent, or, for the root,
329
+
the initial value) to the computed values C[n] returned by the n-th
330
+
argument to cycle(). For the earliest C[n] such that C[n] == I, the
331
+
value returned by cycle is C[n+1]. However, if this C[n] is the last
332
+
value, or if there are no C[n] that equal I, the computed value of the
333
+
first value is returned instead.
334
+
335
+
<divclass="example">
336
+
<p>Make em elements italic, but make them normal if they're inside something that's italic:
337
+
<pre>
338
+
em { font-style: cycle(italic, normal); }
339
+
</pre>
340
+
</div>
341
+
342
+
<divclass="example">
343
+
<p>Cycle between markers for nested lists, so that the top level has disk markers, but nested lists use circle, square, box, and then (for the 5th list deep) repeat:
344
+
345
+
<pre>
346
+
ul { list-style-type: disk; }
347
+
li > ul { list-style-type: cycle(disk, circle, square, box); }
348
+
</pre>
349
+
</div>
350
+
351
+
<p>Nested cycle() values are not allowed.
352
+
353
+
240
354
<h2>Keywords</h2>
241
355
242
356
<p>In the value definition fields, keywords appear literally. Keywords are identifiers.</p>
0 commit comments