Skip to content

Commit

Permalink
fix: proper ul/ol numbering in nested lists
Browse files Browse the repository at this point in the history
  • Loading branch information
aviskase committed Dec 13, 2023
1 parent f428ae3 commit d9f6628
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions assets/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ article ul {
margin-bottom: 2.4rem;
}


article ol > li {
counter-increment: counts;
display: table;
}

Expand All @@ -331,13 +331,19 @@ article ul > li {


article ol > li:before {
content: counters(counts, '.') '.';
counter-increment: counts;
content: counter(counts)'. ';
font-weight: bolder;
color: theme(colors.blue.500);
display: table-cell;
padding-right: 1.5rem;
}


article ol ol > li:before {
content: counters(counts, '.') '.';
}

article li ol li:last-child, article li ol, article li ul li:last-child, article li ul {
margin: 0;
}
Expand Down
6 changes: 6 additions & 0 deletions content/articles/1992/1992-01-01-elements/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ Unordered:
- List item
- List item

Next list:
1. List item
2. List item

---

Expand All @@ -111,6 +114,9 @@ With _some_ lists and [link A](https://google.com) and [link B](../test):

- a
- b

1. a
2. b
{{< /warning >}}

{{< note >}}
Expand Down

0 comments on commit d9f6628

Please sign in to comment.