Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add a nested attribute to ol element #1033
Suggestion, add a nested attribute for the ol element to avoid all the CSS needed to do this. For example:
To render as:
A. First main item
... and maybe also a delimiter attribute to specify what the separator character should be for nested lists, with the default being a "." For example in the above:
<ol type="1" nested delimiter=""> would generate A1, A2, etc.
Thanks for this suggestion.
For new features to be considered for inclusion, there needs to be a proposal and evidence that there is a need for the solution in the wild. This usually comes in the form of a polyfill that has wide adoption (showing that there is interest from the developer community), and then commitment from at least two browser vendors to implement the proposed solution.
The exact display sounds more like a topic for CSS which offers more flexibilty already, see https://www.w3.org/TR/css-counter-styles-3/ for example. It offers a mechanism to set a different suffix than the default dot for example.
Edit: Sorry – I missed that you wanted to avoid CSS. Why though? Anyway, the WICG seems like a good place to start.
Many thanks for all the helpful comments.
To prlbr, regarding your question, the reason behind my comment about avoiding CSS was actually accessibility related. All my searching for ways to get a hierarchical ol list such as A.2.1 involved counters combined with using content: and my understanding (perhaps incorrect) was that content added using CSS content: presented accessibility problems with screen readers. Appreciate your suggestion that a more appropriate place for this topic this might be WICG, thanks.