Skip to content

Commit c43366c

Browse files
authored
Merge pull request #2131 from ehuss/ol-spacing
Fix spacing with ordered lists
2 parents 88204f0 + 9a424fb commit c43366c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

theme/reference.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,15 @@ hr {
322322
Ideally we'd add `<div>`s for each grid cell, so that margin collapsing happens
323323
as-usual inside of them. But, we don't have that kind of control over mdbook. */
324324
main > ul > li > *:first-child,
325-
main > ul > li > pre:first-child > pre.playground {
325+
main > ul > li > pre:first-child > pre.playground,
326+
main > ol:not(.footnote-definition) > li > *:first-child,
327+
main > ol:not(.footnote-definition) > li > pre:first-child > pre.playground {
326328
margin-top: 0;
327329
}
328330
main > ul > li > *:last-child,
329-
main > ul > li > pre:last-child > pre.playground {
331+
main > ul > li > pre:last-child > pre.playground,
332+
main > ol:not(.footnote-definition) > li > *:last-child,
333+
main > ol:not(.footnote-definition) > li > pre:last-child > pre.playground {
330334
margin-bottom: 0;
331335
}
332336

@@ -338,7 +342,8 @@ main {
338342
main > p,
339343
main > pre,
340344
main > pre > pre.playground,
341-
main > ul {
345+
main > ul,
346+
main > ol {
342347
margin-top: 0;
343348
margin-bottom: 0;
344349
}
@@ -480,7 +485,8 @@ main > .rule {
480485

481486
/* Align rules to various siblings */
482487
.rule:has(+ p, + .tests-popup + p),
483-
.rule:has(+ ul, + .tests-popup + ul) {
488+
.rule:has(+ ul, + .tests-popup + ul),
489+
.rule:has(+ ol, + .tests-popup + ol) {
484490
margin-top: calc((1em - var(--font-size)) / var(--font-size-mult) / 2);
485491
}
486492

0 commit comments

Comments
 (0)