1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-20 21:01:18 -04:00

detatch theme provider from stitches logic

This commit is contained in:
2024-02-15 10:48:45 -05:00
parent b5f0f56702
commit 6f5c066525
11 changed files with 41 additions and 144 deletions

View File

@@ -1,16 +1,12 @@
import { Html, Head, Main, NextScript } from "next/document";
import ThemeScript from "../components/ThemeScript";
import { getCssText, themeClassNames, themeStorageKey } from "../lib/styles/stitches.config";
import { getCssText, theme } from "../lib/styles/stitches.config";
import * as config from "../lib/config";
// https://nextjs.org/docs/advanced-features/custom-document
const Document = () => {
return (
<Html lang={config.siteLocale} className={themeClassNames["light"]}>
<Html lang={config.siteLocale} className={theme.className}>
<Head>
{/* inject this script (generated at build-time) to prioritize setting/restoring the user's theme. */}
<ThemeScript key="restore-theme-js" {...{ themeClassNames, themeStorageKey }} />
<style id="stitches" dangerouslySetInnerHTML={{ __html: getCssText() }} />
</Head>
<body>