diff --git a/eslint.config.mjs b/eslint.config.mjs index 09fcb870..8efc234e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -26,7 +26,9 @@ export default antfu( '**/.vercel/', '**/dist/', '**/styles/vjs.css', + // some files that make eslint/prettier panic 'website/src/components/Posthog.astro', + 'website/src/components/ThemeInit.astro', ], plugins: { 'jsx-a11y': jsxA11y, diff --git a/website/TODO.md b/website/TODO.md index afbf9521..22d80790 100644 --- a/website/TODO.md +++ b/website/TODO.md @@ -8,5 +8,4 @@ not comprehensive. just the things I'm worried about forgetting - animations - docs features - copy code blocks -- dark mode - search diff --git a/website/astro.config.mjs b/website/astro.config.mjs index 536b8227..6d494ec0 100644 --- a/website/astro.config.mjs +++ b/website/astro.config.mjs @@ -36,6 +36,7 @@ export default defineConfig({ shikiConfig: { themes: { light: 'gruvbox-light-hard', + dark: 'gruvbox-dark-medium', }, // TODO shiki transformers }, diff --git a/website/src/components/ClientCode.tsx b/website/src/components/ClientCode.tsx index 4e44027e..390b9cd2 100644 --- a/website/src/components/ClientCode.tsx +++ b/website/src/components/ClientCode.tsx @@ -3,6 +3,7 @@ import clsx from 'clsx'; import { createHighlighter, hastToHtml } from 'shiki'; import html from 'shiki/langs/html.mjs'; import tsx from 'shiki/langs/tsx.mjs'; +import gruvboxDarkSoft from 'shiki/themes/gruvbox-dark-soft.mjs'; import gruvboxLightHard from 'shiki/themes/gruvbox-light-hard.mjs'; // If you try importing more than one island with ClientCode in it, @@ -12,7 +13,7 @@ import gruvboxLightHard from 'shiki/themes/gruvbox-light-hard.mjs'; // eslint-disable-next-line antfu/no-top-level-await const highlighter: Highlighter = await createHighlighter({ - themes: [gruvboxLightHard], + themes: [gruvboxLightHard, gruvboxDarkSoft], langs: [html, tsx], }); @@ -25,7 +26,10 @@ export interface ClientCodeProps { export default function ClientCode({ code, lang, className }: ClientCodeProps) { const hast = highlighter.codeToHast(code, { lang, - theme: 'gruvbox-light-hard', + themes: { + light: 'gruvbox-light-hard', + dark: 'gruvbox-dark-soft', + }, }); // shiki gives us a root > pre > code > text structure @@ -51,7 +55,7 @@ export default function ClientCode({ code, lang, className }: ClientCodeProps) { return (
       
-  
+