w3c / w3c/csswg-drafts

[css-lists] Should list-item counter reset rule be in a UA stylesheet?

Open
#4,244 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-lists-3
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

Or should it be browser-engine magic like the increment?

The TLDR is this. Gecko implements the counter reset as suggested in the appendix:

https://drafts.csswg.org/css-lists/#ua-stylesheet

Which is something like:

/* Set up ol and ul so that they scope the list-item counter */
ol, ul {
  counter-reset: list-item;
}

So the issue with doing it at the UA stylesheet level is that pages can override it.

We've received two reports of broken lists, the first of them is fixed, the second of them is from today. So arguably not a lot of breakage, but still worth discussing, I think.

cc @MatsPalmgren @tabatkins

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CSS Lists specification's UA stylesheet appendix and the two linked Bugzilla reports. Review whether the list-item counter reset should be specified in the UA stylesheet or left to browser-engine behavior; done means reaching and documenting a standards decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.