Skip to content

Commit

Permalink
fix: rehype-shiki themes
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Sep 27, 2024
1 parent 59127e6 commit 0f06de9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/vite/plugins/mdx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ type RehypePluginsParameters = {
twoslash?: ParsedConfig['twoslash'] | false
}

const defaultThemes = {
dark: 'github-dark-dimmed',
light: 'github-light',
}

export const getRehypePlugins = ({
markdown,
rootDir = '',
Expand Down Expand Up @@ -123,10 +128,17 @@ export const getRehypePlugins = ({
: null,
transformerSplitIdentifiers(),
].filter(Boolean),
themes: defaultThemes,
...markdown?.code,
} as RehypeShikiOptions,
],
[rehypeInlineShiki, markdown?.code],
[
rehypeInlineShiki,
{
themes: defaultThemes,
...markdown?.code,
},
],
rehypeShikiDisplayNotation,
[
rehypeAutolinkHeadings,
Expand Down

0 comments on commit 0f06de9

Please sign in to comment.