Skip to content

Commit 366d171

Browse files
committed
Switched symbols() to put type first, refined the definition to exclude identifiers.
1 parent 0e9f439 commit 366d171

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

css3-lists/Overview.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,12 +2324,9 @@ <h2 id=symbols-function><span class=secno>9. </span> Defining Anonymous
23242324
is:
23252325

23262326
<pre><dfn
2327-
id=type-symbols-function>&lt;symbols-function></dfn> = symbols( &lt;symbols> [as &lt;type>]? )</pre>
2327+
id=type-symbols-function>&lt;symbols-function></dfn> = symbols( &lt;type>? [ &lt;string> | &lt;image> ]+ )</pre>
23282328

2329-
<p>Where &lt;symbols> is a valid value for the &lsquo;<a
2330-
href="#descdef-symbols"><code class=property>symbols</code></a>&rsquo;
2331-
descriptor in a &lsquo;<code class=css>@counter-style</code>&rsquo; rule,
2332-
and &lt;type> is one of the following keywords: &lsquo;<code
2329+
<p>Where &lt;type> is one of the following keywords: &lsquo;<code
23332330
class=css>repeating</code>&rsquo;, &lsquo;<code
23342331
class=css>numeric</code>&rsquo;, &lsquo;<code
23352332
class=css>alphabetic</code>&rsquo;, &lsquo;<code
@@ -2374,7 +2371,7 @@ <h2 id=symbols-function><span class=secno>9. </span> Defining Anonymous
23742371

23752372
<p>On the other hand, specifying the type of counter, like so:</p>
23762373

2377-
<pre>ol { list-style: symbols("*" "\2020" "\2021" "\A7" as repeating); }</pre>
2374+
<pre>ol { list-style: symbols(repeating "*" "\2020" "\2021" "\A7"); }</pre>
23782375

23792376
<p>will produce lists that look like:</p>
23802377

@@ -2388,6 +2385,12 @@ <h2 id=symbols-function><span class=secno>9. </span> Defining Anonymous
23882385
‡ Seven</pre>
23892386
</div>
23902387

2388+
<p class=note>Note that the &lsquo;<a href="#descdef-symbols"><code
2389+
class=css>symbols()</code></a>&rsquo; function only allows strings and
2390+
images, while the &lsquo;<a href="#descdef-symbols"><code
2391+
class=property>symbols</code></a>&rsquo; descriptor of a &lsquo;<code
2392+
class=css>@counter-style</code>&rsquo; rule also allows identifiers.
2393+
23912394
<h2 id=ua-stylesheet><span class=secno>10. </span> Predefined Counter
23922395
Styles</h2>
23932396

css3-lists/Overview.src.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,9 +1551,9 @@ <h2 id='symbols-function'>
15511551

15521552
<p>The previous chapter specified a way to define custom counter styles. However, counter styles are sometimes used only once in a stylesheet, and defining a full ''@counter-style'' rule can be overkill for this case (not to mention the possibility of unintentional name collisions). To address this case, the ''symbols()'' function provides a simple way to define an anonymous counter style as an inline value. It does not provide the full feature-set of the ''@counter-style'' rule, but provides a sufficient subset to still be useful. The syntax of the ''symbols()'' rule is:</p>
15531553

1554-
<pre><dfn id='type-symbols-function'>&lt;symbols-function></dfn> = symbols( &lt;symbols> [as &lt;type>]? )</pre>
1554+
<pre><dfn id='type-symbols-function'>&lt;symbols-function></dfn> = symbols( &lt;type>? [ &lt;string> | &lt;image> ]+ )</pre>
15551555

1556-
<p>Where &lt;symbols> is a valid value for the 'symbols' descriptor in a ''@counter-style'' rule, and &lt;type> is one of the following keywords: ''repeating'', ''numeric'', ''alphabetic'', ''symbolic'', or ''non-repeating''.</p>
1556+
<p>Where &lt;type> is one of the following keywords: ''repeating'', ''numeric'', ''alphabetic'', ''symbolic'', or ''non-repeating''.</p>
15571557

15581558
<p>The ''symbols()'' function defines an anonymous counter style with no <i title="counter-name">name</i>, a <i title="counter-prefix">prefix</i> and <i title="counter-suffix">suffix</i> of ''""'' (the empty string), a <i title="counter-lower-bound">lower bound</i> of negative infinity, an <i title="counter-upper-bound">upper bound</i> of infinity, an <i title="counter-fallback">fallback style</i> of ''decimal'', and a <i title="counter-negative">negative sign</i> of "\2D" ("-" hyphen-minus). The counter style's <i title="counter-algorithm">algorithm</i> is constructed by consulting the previous chapter using the provided type - or ''symbolic'' if the type was omitted - and the provided &lt;symbols> as the value of the 'symbols' property.</p>
15591559

@@ -1575,7 +1575,7 @@ <h2 id='symbols-function'>
15751575

15761576
<p>On the other hand, specifying the type of counter, like so:</p>
15771577

1578-
<pre>ol { list-style: symbols("*" "\2020" "\2021" "\A7" as repeating); }</pre>
1578+
<pre>ol { list-style: symbols(repeating "*" "\2020" "\2021" "\A7"); }</pre>
15791579

15801580
<p>will produce lists that look like:</p>
15811581

@@ -1589,6 +1589,8 @@ <h2 id='symbols-function'>
15891589
‡ Seven</pre>
15901590
</div>
15911591

1592+
<p class='note'>Note that the ''symbols()'' function only allows strings and images, while the 'symbols' descriptor of a ''@counter-style'' rule also allows identifiers.</p>
1593+
15921594

15931595
<h2 id='ua-stylesheet'>
15941596
Predefined Counter Styles</h2>

0 commit comments

Comments
 (0)