Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Add a nested attribute to ol element #1033

Closed
ghost opened this issue Sep 27, 2017 · 4 comments
Closed

Add a nested attribute to ol element #1033

ghost opened this issue Sep 27, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 27, 2017

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.

@LJWatson
Copy link
Collaborator

LJWatson commented Oct 2, 2017

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.

@prlbr
Copy link
Contributor

prlbr commented Oct 3, 2017

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.

@ghost
Copy link
Author

ghost commented Oct 3, 2017

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.

@chaals
Copy link
Collaborator

chaals commented Oct 10, 2017

This has now been opened as an incubation idea (thank you)

@chaals chaals closed this as completed Oct 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants