diff --git a/app/layout.tsx b/app/layout.tsx index 85e9cd8..c9189b5 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -39,7 +39,7 @@ export default function RootLayout({ crossOrigin="" /> - +
diff --git a/components/pages/dark-mode-btn.tsx b/components/pages/dark-mode-btn.tsx index 24ac8d2..237b5e5 100644 --- a/components/pages/dark-mode-btn.tsx +++ b/components/pages/dark-mode-btn.tsx @@ -8,12 +8,12 @@ const DarkModeBtn = () => { const { mounted } = useMounted(); const { systemTheme, theme, setTheme } = useTheme(); const currentTheme = theme === 'system' ? systemTheme : theme; - const handleTheme = (type: 'light' | 'dark') => () => { - const map = { - light: 'latte', - dark: 'mocha', - }; - document.body.className = map[type]; + const handleTheme = (type: 'latte' | 'mocha') => () => { + // const map = { + // light: 'latte', + // dark: 'mocha', + // }; + // document.body.className = map[type]; setTheme(type); }; @@ -32,13 +32,13 @@ const DarkModeBtn = () => { return ( <> - {currentTheme === 'dark' ? ( + {currentTheme === 'mocha' ? ( ) : ( )} diff --git a/components/pages/gists/gists-code.tsx b/components/pages/gists/gists-code.tsx index 1a1444b..63945a3 100644 --- a/components/pages/gists/gists-code.tsx +++ b/components/pages/gists/gists-code.tsx @@ -1,13 +1,14 @@ -import rehypePrism from '@mapbox/rehype-prism'; import clsx from 'clsx'; import { createElement, Fragment, memo } from 'react'; import rehypeReact from 'rehype-react'; import remarkGfm from 'remark-gfm'; import remarkParse from 'remark-parse'; import remarkRehype from 'remark-rehype'; +import rehypeHighlight from 'rehype-highlight'; import { GistsFile } from 'types'; import { unified } from 'unified'; import styles from './gists-code.module.css'; +import '@catppuccin/highlightjs/sass/catppuccin.variables.scss'; interface Props { file: GistsFile; @@ -22,7 +23,7 @@ const GistsCode = ({ file, showFileName = false }: Props) => { .use(remarkParse) .use(remarkRehype) .use(remarkGfm) - .use(rehypePrism, { ignoreMissing: true }) + .use(rehypeHighlight, { ignoreMissing: true }) .use(rehypeReact, { createElement, Fragment, diff --git a/components/pages/theme-provider.tsx b/components/pages/theme-provider.tsx index b3031c9..2e54fdb 100644 --- a/components/pages/theme-provider.tsx +++ b/components/pages/theme-provider.tsx @@ -12,7 +12,7 @@ export default function RUAThemeProvider({ diff --git a/tailwind.config.js b/tailwind.config.js index 6a0aee2..d145935 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,5 +1,5 @@ module.exports = { - darkMode: 'class', + darkMode: ['class', '.mocha'], plugins: [require('@catppuccin/tailwindcss')], content: [ './app/**/*.{js,ts,jsx,tsx,md,mdx}',