Skip to content

Commit

Permalink
Reset the top margin of paragraphs and admonitions if they are first …
Browse files Browse the repository at this point in the history
…elements in markdown content (#184)

Signed-off-by: Damian Stasik <[email protected]>
  • Loading branch information
damianstasik authored Sep 5, 2024
1 parent c47105a commit 3e2a67e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/components/Markdown/P.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export function MarkdownP({ children }: HTMLAttributes<HTMLParagraphElement>) {
return (
<div
role="alert"
className={clsx("mt-5 px-3 py-2 [li>&:first-child]:mt-0", className)}
className={clsx(
"mt-5 px-3 py-2 first:mt-0 [li>&:first-child]:mt-0",
className,
)}
>
{content}
{remainingContent}
Expand All @@ -66,7 +69,7 @@ export function MarkdownP({ children }: HTMLAttributes<HTMLParagraphElement>) {
}

return (
<Paragraph className="mt-5 leading-7 [li>&:first-child]:mt-0">
<Paragraph className="mt-5 leading-7 first:mt-0 [li>&:first-child]:mt-0">
{children}
</Paragraph>
);
Expand Down

0 comments on commit 3e2a67e

Please sign in to comment.