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
Defining Anonymous Counter Styles: the ''symbols()'' function</h2>
822
822
823
-
<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>Where <type> is one of the following keywords: ''repeating'', ''numeric'', ''alphabetic'', ''symbolic'', or ''non-repeating''.
836
+
<p>
837
+
Where <symbols-type> is one of the following keywords:
838
+
''repeating'', ''numeric'', ''alphabetic'', ''symbolic'', or ''non-repeating''.
828
839
829
-
<p>The ''symbols()'' function defines an anonymous counter style with no <ititle="counter-name">name</i>, a <ititle="counter-prefix">prefix</i> and <ititle="counter-suffix">suffix</i> of ''""'' (the empty string), a <ititle="counter-range">range</i> from negative infinity to positive infinity, an <ititle="counter-fallback">fallback style</i> of ''decimal'', and a <ititle="counter-negative">negative sign</i> of "\2D" ("-" hyphen-minus). The counter style's <ititle="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 <string>s and <image>s as the value of the 'symbols' property. If the type is ''non-repeating'', the <i>first symbol value</i> is ''1''.
840
+
<p>
841
+
The ''symbols()'' function defines an anonymous counter style
842
+
with no <ititle="counter-name">name</i>,
843
+
a <ititle="counter-prefix">prefix</i>
844
+
and <ititle="counter-suffix">suffix</i> of ''""'' (the empty string),
845
+
a <ititle="counter-range">range</i> from negative infinity to positive infinity,
846
+
n <ititle="counter-fallback">fallback style</i> of ''decimal'',
847
+
and a <ititle="counter-negative">negative sign</i> of "\2D" ("-" hyphen-minus).
848
+
The counter style's <ititle="counter-algorithm">algorithm</i> is constructed
849
+
by consulting the previous chapter using the provided type
850
+
- or ''symbolic'' if the type was omitted -
851
+
and the provided <string>s and <image>s as the value of the 'symbols' property.
852
+
If the type is ''non-repeating'', the <i>first symbol value</i> is ''1''.
<pclass='note'>Note that the ''symbols()'' function only allows strings and images, while the 'symbols' descriptor of a ''@counter-style'' rule also allows identifiers.
890
+
<pclass='note'>
891
+
Note that the ''symbols()'' function only allows strings and images,
892
+
while the 'symbols' descriptor of a ''@counter-style'' rule also allows identifiers.
864
893
865
894
866
895
<!--
@@ -891,7 +920,12 @@ <h2 id='symbols-function'>
891
920
<h2id='predefined-counters'>
892
921
Simple Predefined Counter Styles</h2>
893
922
894
-
<p>The following stylesheet redefines all of the counter styles defined in CSS 2.1 using the ''@counter-style'' rule. This stylesheet is normative - UAs must include it in their UA stylesheet.
923
+
<p>
924
+
The following stylesheet uses the ''@counter-style'' rule
925
+
to redefine all of the counter styles defined in CSS 2 and CSS 2.1,
926
+
plus
927
+
This stylesheet is normative -
928
+
UAs must include it in their UA stylesheet.
895
929
896
930
897
931
<h3id='simple-numeric'>
@@ -949,7 +983,7 @@ <h3 id='simple-numeric'>
949
983
}</bdo></pre>
950
984
951
985
<p>
952
-
The ''decimal'' counter-style is not overridable with a @counter-style rule,
986
+
The ''decimal'' counter-style must not be overridable with a @counter-style rule,
953
987
so that it is always available as an ultimate fallback style.
0 commit comments