Skip to content

<ol> style type based on type attribute #7542

@joapuiib

Description

@joapuiib

Context

I'm using a Markdown extension that allows writing different types of lists.

  • Lower alphabetic: <ol type="a">
  • Upper alphabetic: <ol type="A">
  • Lower roman: <ol type="i">
  • Upper roman: <ol type="I">

Description

The following CSS overrides the default list styles, so the first nested <ol> will always be rendered as alphabetic regarding the type attribute.

// Nested ordered list
ol {
list-style-type: lower-alpha;
// Triply nested ordered list
ol {
list-style-type: lower-roman;
}
}

Could this be set only if <ol> doesn't have a specific type?

ol, ul {
  // Nested ordered list
  ol:not([type]) { 
     list-style-type: lower-alpha;
  }

  ol, ul {
     // Triply nested ordered list 
    ol:not([type]) { 
       list-style-type: lower-roman; 
    }
  }
}

Related links

Use Cases

For example, writing:

1. List item
2. List item
    1. List item
    2. List item
    3. List item

Will result on:

1. List item
2. List item
    a. List item
    b. List item
    c. List item

Instead of:

1. List item
2. List item
    1. List item
    2. List item
    3. List item

Which might not always be desirable.

Visuals

No response

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    change requestIssue requests a new feature or improvementresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions