Skip to content

Commit ad6e83b

Browse files
committed
style: Add dark mode styles for code blocks in CSS and update TSX import
1 parent 843589c commit ad6e83b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/Code/Code.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
html.dark .code-block,
2+
html.dark .code-block span {
3+
color: var(--shiki-dark) !important;
4+
background-color: var(--shiki-dark-bg) !important;
5+
/* Optional, if you also want font styles */
6+
font-style: var(--shiki-dark-font-style) !important;
7+
font-weight: var(--shiki-dark-font-weight) !important;
8+
text-decoration: var(--shiki-dark-text-decoration) !important;
9+
}

lib/Code/Code.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { codeToHast } from 'shiki';
44
import { Components, toJsxRuntime } from 'hast-util-to-jsx-runtime';
55
import { Fragment } from 'react';
66
import { jsx, jsxs } from 'react/jsx-runtime';
7+
import './Code.css';
78

89
interface Props {
910
children: string;

0 commit comments

Comments
 (0)