Skip to content

Commit

Permalink
style: Add dark mode styles for code blocks in CSS and update TSX import
Browse files Browse the repository at this point in the history
  • Loading branch information
websiddu committed Dec 22, 2024
1 parent 843589c commit ad6e83b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Code/Code.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
html.dark .code-block,
html.dark .code-block span {
color: var(--shiki-dark) !important;
background-color: var(--shiki-dark-bg) !important;
/* Optional, if you also want font styles */
font-style: var(--shiki-dark-font-style) !important;
font-weight: var(--shiki-dark-font-weight) !important;
text-decoration: var(--shiki-dark-text-decoration) !important;
}
1 change: 1 addition & 0 deletions lib/Code/Code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { codeToHast } from 'shiki';
import { Components, toJsxRuntime } from 'hast-util-to-jsx-runtime';
import { Fragment } from 'react';
import { jsx, jsxs } from 'react/jsx-runtime';
import './Code.css';

interface Props {
children: string;
Expand Down

0 comments on commit ad6e83b

Please sign in to comment.