Skip to content

Commit

Permalink
fix: improve display styles for ordered lists
Browse files Browse the repository at this point in the history
  • Loading branch information
brotheroftux committed Feb 3, 2025
1 parent 64cdd9a commit 64e5331
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/scss/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -307,25 +307,28 @@
margin-bottom: 0;
}

&:not(.yfm_no-list-reset) {
ol {
list-style-type: none;
counter-reset: list;

& > li {
position: relative;
counter-increment: list;

&::before {
position: absolute;
right: 100%;
margin-right: 4px;
content: counters(list, '.') '. ';
}
}
ol {
counter-reset: list;

& > li {
position: relative;
counter-increment: list;
}
}

ol > li > ol > li::marker {
content: counters(list, '.') '. ';
}

:not(ol > li) > ol > li::marker {
content: counter(list) '. ';
}

// No direct ancestor (>) combinator to preserve legacy behavior
ol.yfm_no-list-reset li::marker {
content: unset;
}

li {
word-wrap: break-word;
}
Expand Down

0 comments on commit 64e5331

Please sign in to comment.