From ac002b358c3bcda7549a87aa9455fcd483fb56ef Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Fri, 21 Jun 2024 16:56:54 -0500 Subject: [PATCH] markdown: Improve alignment, spacing around horizontal rules. --- web/styles/rendered_markdown.css | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web/styles/rendered_markdown.css b/web/styles/rendered_markdown.css index a497e06b48..507c866040 100644 --- a/web/styles/rendered_markdown.css +++ b/web/styles/rendered_markdown.css @@ -35,6 +35,13 @@ border-top: 1px solid hsl(0deg 0% 87%); /* Override Bootstrap with doubled interelement space */ margin: calc(var(--markdown-interelement-space-px) * 2) 0; + + &:first-child { + /* When a horizontal rule opens a message, or any other + area in the message area (e.g., spoilers), there + should be no space above the rule. */ + margin-top: 0; + } } /* Headings */ @@ -407,7 +414,9 @@ `.rendered_markdown` out of the baseline group formed with EDITED/MOVED markers and the timestamp when the first child of the rendered - markdown is a media element or KaTeX. */ + markdown is a horizontal rule, a media element, + or KaTeX. */ + &:has(> hr:first-child), &:has(> .message_inline_image:first-child), &:has(> p:first-child > .katex-display) { align-self: center;