Skip to content

Commit a5fb9fb

Browse files
committed
[css-lists-3] Add example of using list-item counter. Add normative prose supporting this example that we expect to work. Related to discussion in #3686 (and a number of more ancient WG discussions)
1 parent 5e7350b commit a5fb9fb

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

css-lists-3/Overview.bs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,55 @@ The Implicit ''list-item'' Counter</h3>
814814
See old <a href="https://github.com/w3c/csswg-drafts/issues/2464#issuecomment-375492907">WG discussions</a>
815815
and newer <a href="https://github.com/w3c/csswg-drafts/issues/3686">issue discussion</a>.
816816

817+
UAs and host languages should ensure
818+
that the ''counter-increment/list-item'' counter values
819+
reflect the underlying numeric value dictated by host language semantics
820+
when setting up list item styling
821+
in their UA style sheet and presentational hint style mappings.
822+
<span class="issue">Not really sure how to word this requirement,
823+
but the following example is expected to work.</span>
824+
825+
<div class="example">
826+
In the following example,
827+
the 'content' property is used to create tiered numbering
828+
that hooks into the ''counter-increment/list-item'' counter,
829+
and thus respects any numbering changes inflicted through HTML:
830+
<pre>
831+
ol::marker { content: counters(list-item,'.') '.'; }
832+
</pre>
833+
Nested lists using this rule would be rendered like
834+
<pre>
835+
1. First top-level item
836+
5. Second top-level item, value=5
837+
5.3. First second-level item, list start=3
838+
5.4. Second second-level item, list start=3
839+
5.4.4. First third-level item in reversed list
840+
5.4.3. Second third-level item in reversed list
841+
5.4.2. Third third-level item in reversed list
842+
5.4.1. Fourth third-level item in reversed list
843+
5.5. Third second-level item, list start=3
844+
6. Third top-level item
845+
</pre>
846+
given markup such as
847+
<pre>
848+
<ol>
849+
<li>First top-level item
850+
<li value=5>Second top-level item, value=5
851+
<ol start=3>
852+
<li>First second-level item, list start=3
853+
<li>Second second-level item, list start=3
854+
<ol reversed>
855+
<li>First third-level item in reversed list
856+
<li>Second third-level item in reversed list
857+
<li>Third third-level item in reversed list
858+
<li>Fourth third-level item in reversed list
859+
</ol>
860+
<li>Third second-level item, list start=3
861+
<li>Third top-level item
862+
</ol>
863+
</pre>
864+
</div>
865+
817866
<h3 id="creating-counters">
818867
Creating and Inheriting Counters</h3>
819868

0 commit comments

Comments
 (0)