Skip to content

Commit 0ab9dd9

Browse files
fix(markdown): restore text-foreground on code/pre in light mode
1 parent d95efb6 commit 0ab9dd9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/components/content/MarkdownContent.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ const components: Components = {
1212
pre: ({ children, ...props }) => (
1313
<pre
1414
{...props}
15-
className="overflow-x-auto max-w-full rounded bg-code px-3 py-2 text-xs font-mono"
15+
className="overflow-x-auto max-w-full rounded bg-code px-3 py-2 text-xs font-mono text-foreground"
1616
>
1717
{children}
1818
</pre>
1919
),
2020
code: ({ children, ...props }) => (
2121
<code
2222
{...props}
23-
className="break-all rounded bg-code px-1 py-0.5 text-xs font-mono"
23+
className="break-all rounded bg-code px-1 py-0.5 text-xs font-mono text-foreground"
2424
>
2525
{children}
2626
</code>
@@ -55,7 +55,7 @@ interface MarkdownContentProps {
5555
export default function MarkdownContent({ children, className }: MarkdownContentProps) {
5656
return (
5757
<div
58-
className={`prose prose-sm max-w-none overflow-hidden [overflow-wrap:break-word] dark:prose-invert ${className ?? ""}`}
58+
className={`prose prose-sm max-w-none overflow-hidden [overflow-wrap:break-word] dark:prose-invert prose-pre:text-foreground prose-code:text-foreground ${className ?? ""}`}
5959
>
6060
<ReactMarkdown remarkPlugins={[remarkGfm]} components={components}>
6161
{children}

0 commit comments

Comments
 (0)