Restyle markdown code blocks: dark background, smaller font, compact padding
- Switch code block background from transparent accent to dark (#1e1e2e) with light text (#cdd6f4) for better readability in both light and dark modes - Reduce code font size from 0.84em to 0.78em - Compact padding and margins on pre blocks - Hide MDXEditor code block toolbar by default, show on hover/focus to prevent overlap with code content on mobile - Use horizontal scroll instead of word-wrap for code blocks to preserve formatting Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -117,7 +117,7 @@ export function MarkdownBody({ children, className }: MarkdownBodyProps) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"paperclip-markdown prose prose-sm max-w-none break-words overflow-hidden prose-pre:whitespace-pre-wrap prose-pre:break-words prose-code:break-all",
|
||||
"paperclip-markdown prose prose-sm max-w-none break-words overflow-hidden prose-pre:my-1.5 prose-pre:px-2.5 prose-pre:py-2 prose-pre:overflow-x-auto prose-pre:whitespace-pre prose-code:break-all prose-code:text-[inherit]",
|
||||
theme === "dark" && "prose-invert",
|
||||
className,
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user