Skip to content

Commit 1e547d4

Browse files
committed
Fix code blocks in dark mode
1 parent fb19407 commit 1e547d4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/eight-laws-find.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"streamdown": patch
3+
---
4+
5+
Fix code blocks in dark mode

packages/streamdown/lib/code-block/body.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const CodeBlockBody = memo(
3535

3636
return (
3737
<pre
38-
className={cn(className, "p-4 text-sm")}
38+
className={cn(className, "p-4 text-sm dark:bg-(--shiki-dark-bg)!")}
3939
data-code-block
4040
data-language={language}
4141
style={preStyle}
@@ -50,6 +50,7 @@ export const CodeBlockBody = memo(
5050
>
5151
{row.map((token, tokenIndex) => (
5252
<span
53+
className="dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!"
5354
// biome-ignore lint/suspicious/noArrayIndexKey: "This is a stable key."
5455
key={tokenIndex}
5556
style={{

0 commit comments

Comments
 (0)