-
Notifications
You must be signed in to change notification settings - Fork 533
Add a nested attribute to ol element #1033
Comments
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. If the current CSS options are not sufficient, you could discuss this with the CSSWG or maybe get input from WICG first. 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. |
This has now been opened as an incubation idea (thank you) |
Suggestion, add a nested attribute for the ol element to avoid all the CSS needed to do this. For example:
<ol type="A">
<li>First main item
<ol type="1" nested>
<li>First item first sub-topic</li>
<li>First item second sub-topic</li>
</ol>
</li>
<li>Second main item
<ol type="1" nested >
<li>Second item first sub-topic</li>
<li>Second item second sub-topic</li>
</ol>
</li>
<ol>
To render as:
A. First main item
A.1 First item first sub-topic
A.2 First item second sub-topic
B. Second main item
B.1 Second item first sub-topic
B.2 Second item second sub-topic
... 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.
<ol type="1" nested delimiter="-"> would generate A-1, A-2, etc.
The text was updated successfully, but these errors were encountered: