Skip to content

Commit 93161a3

Browse files
committed
improve margins of nested lists. See #4560
1 parent a4192df commit 93161a3

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

news/changelog-1.3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- Don't display custom appendix sections in the TOC ([#3113](https://github.com/quarto-dev/quarto-cli/issues/3113)).
4141
- Use custom `styles.html` template partial to better support checkbox alignment ([#4556](https://github.com/quarto-dev/quarto-cli/issues/4556)).
4242
- Improve ergonomics of text-highting in HTML output, not emitting difficult overwrite styles and better supporting theme -> CSS conversion. ([#4334](https://github.com/quarto-dev/quarto-cli/issues/4334)).
43+
- Improve CSS of nested tight and loose lists ([#4560](https://github.com/quarto-dev/quarto-cli/discussions/4650)).
4344

4445
## Article Layout
4546

src/resources/formats/html/bootstrap/_bootstrap-rules.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ main {
77
}
88
}
99

10+
// the scss mode for vs code doesn't like the fancy :has(> p) selector, but
11+
// it's valid: https://developer.mozilla.org/en-US/docs/Web/CSS/:has
12+
ul > li:not(:has(> p)) > ul,
13+
ol > li:not(:has(> p)) > ul,
14+
ul > li:not(:has(> p)) > ol,
15+
ol > li:not(:has(> p)) > ol {
16+
margin-bottom: 0;
17+
}
18+
ul > li:not(:has(> p)) > ul > li:has(> p) {
19+
margin-top: 1rem;
20+
}
21+
1022
// Grid layout
1123
body {
1224
margin: 0;

src/resources/formats/html/pandoc/styles.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@
7979
li > ol, li > ul {
8080
margin-top: 0;
8181
}
82+
ul > li:not(:has(> p)) > ul,
83+
ol > li:not(:has(> p)) > ul,
84+
ul > li:not(:has(> p)) > ol,
85+
ol > li:not(:has(> p)) > ol {
86+
margin-bottom: 0;
87+
}
88+
ul > li:not(:has(> p)) > ul > li:has(>p) {
89+
margin-top: 1rem;
90+
}
8291
blockquote {
8392
margin: 1em 0 1em 1.7em;
8493
padding-left: 1em;

0 commit comments

Comments
 (0)