Skip to content

Commit 230ca3f

Browse files
committed
[css-counter-styles] Change override to extends. Add example.
--HG-- extra : rebase_source : 3eed1663aeb0007fe4e0d73fabfe2dfa92c3d61e
1 parent 1b9bb03 commit 230ca3f

2 files changed

Lines changed: 163 additions & 105 deletions

File tree

css-counter-styles/Overview.bs

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -658,34 +658,56 @@ Accumulating Numerals: the ''additive'' system</h4>
658658
relative to the size of the counter value.
659659

660660
<!--
661-
███████ ██ ██ ████████ ████████ ████████ ████ ████████ ████████
662-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
663-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
664-
██ ██ ██ ██ ██████ ████████ ████████ ██ ██ ██ ██████
665-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
666-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
667-
███████ ███ ████████ ██ ██ ██ ██ ████ ████████ ████████
661+
█████████ ██ ████████ ████████ ██ ██ ████████ ██████
662+
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
663+
██ ██ ██ ██ ██ ████ ██ ██ ██ ██
664+
██████ ██ ██ ██████ ██ ██ ██ ██ ██ ██████
665+
██ ██ ██ ██ ██ ██ ████ ██ ██ ██
666+
██ ██ ██ ██ ██ ██ ████ ██ ██ ██
667+
████████ ██ ██ ██ ████████ ██ ██ ████████ ██████
668668
-->
669669

670-
<h4 id="override-system">
671-
Tweaking Existing Counter Styles: the ''override'' system</h4>
670+
<h4 id="extends-system">
671+
Tweaking Existing Counter Styles: the ''extends'' system
672+
<span id='override-system'></span></h4>
672673

673-
The <dfn value for="@counter-style/system">override</dfn> system allows an author to use the algorithm of another counter style,
674+
The <dfn value for="@counter-style/system">extends</dfn> system allows an author to use the algorithm of another counter style,
674675
but alter other aspects,
675676
such as the negative sign or the suffix.
676-
If a counter style uses the ''override'' system,
677-
any unspecified descriptors must be taken from the overridden counter style specified,
677+
If a counter style uses the ''extends'' system,
678+
any unspecified descriptors must be taken from the extended counter style specified,
678679
rather than taking their initial values.
679680

680-
If a @counter-style uses the ''override'' system,
681+
If a @counter-style uses the ''extends'' system,
681682
it must not contain a 'symbols' or 'additive-symbols' descriptor,
682683
or else the ''@counter-style'' rule is invalid.
683684

684685
If the specified counter style name isn't the name of any currently-defined counter style,
685-
it must be treated as if it was overriding the ''decimal'' counter style.
686-
If one or more ''@counter-style'' rules form a cycle with their ''override'' values,
686+
it must be treated as if it was extending the ''decimal'' counter style.
687+
If one or more ''@counter-style'' rules form a cycle with their ''extends'' values,
687688
all of the counter styles participating in the cycle
688-
must be treated as if they were overriding the ''decimal'' counter style instead.
689+
must be treated as if they were extending the ''decimal'' counter style instead.
690+
691+
<div class='example'>
692+
For example, if you wanted a counter style that was identical to decimal,
693+
but used a parenthesis rather than a period after it, like:
694+
695+
<pre>
696+
1) first item
697+
2) second item
698+
3) third item
699+
</pre>
700+
701+
Rather than writing up an entirely new counter style,
702+
this can be done by just extending ''decimal'':
703+
704+
<pre class='css'>
705+
@counter-style decimal-paren {
706+
system: extends decimal;
707+
suffix: ") ";
708+
}
709+
</pre>
710+
</div>
689711

690712
<!--
691713
██ ██ ████████ ██████ ███ ████████ ████ ██ ██ ████████
@@ -2341,6 +2363,8 @@ Changes since the July 2013 Working Draft</h2>
23412363
<li>Fix ''ethiopic-numeric'' algorithm step 5.
23422364

23432365
<li>Extended Korean styles to handle negative numbers.
2366+
2367+
<li>Changed "override" system to ''extends''.
23442368
</ul>
23452369

23462370
A <a href="http://dev.w3.org/csswg/css-counter-styles-3/issues-lc-20130718">Disposition of Comments</a> is available.

0 commit comments

Comments
 (0)