markdown: Reduce space when paragraphs precede lists.

This commit is contained in:
Karl Stolley
2025-08-08 10:15:21 -04:00
committed by Tim Abbott
parent a644874e76
commit d089c42c98

View File

@@ -13,6 +13,13 @@
.rendered_markdown { .rendered_markdown {
& p { & p {
margin: 0 0 var(--markdown-interelement-space-px); margin: 0 0 var(--markdown-interelement-space-px);
&:has(+ ul, + ol) {
/* When a paragraph is immediately followed
by a list sibling, we reduce the paragraph's
ordinary bottom space by half. */
margin-bottom: calc(var(--markdown-interelement-space-px) / 2);
}
} }
/* The spacing between two paragraphs is double the usual value. /* The spacing between two paragraphs is double the usual value.
@@ -82,16 +89,6 @@
} }
} }
& ul,
& ol {
& p:has(+ ul, + ol) {
/* When a paragraph inside a list is immediately followed
by a list sibling, we reduce the paragraph's ordinary
bottom space by half. */
margin-bottom: calc(var(--markdown-interelement-space-px) / 2);
}
}
/* To avoid cutting off the focus ring on links, we set /* To avoid cutting off the focus ring on links, we set
padding on first children most likely to take links. padding on first children most likely to take links.
We account for this extra space on `.message_content`. */ We account for this extra space on `.message_content`. */