mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 18:06:38 -04:00
set html class to light theme in static output
This commit is contained in:
@ -1,15 +1,16 @@
|
||||
import { Html, Head, Main, NextScript } from "next/document";
|
||||
import ThemeScript from "../components/ThemeScript/ThemeScript";
|
||||
import { getCssText, preloadFonts } from "../lib/styles/stitches.config";
|
||||
import { themeClassNames, themeDefault, themeStorageKey } from "../lib/config/themes";
|
||||
import * as config from "../lib/config";
|
||||
|
||||
// https://nextjs.org/docs/advanced-features/custom-document
|
||||
const Document = () => {
|
||||
return (
|
||||
<Html lang={config.siteLocale}>
|
||||
<Html lang={config.siteLocale} className={themeClassNames[themeDefault]}>
|
||||
<Head>
|
||||
{/* inject a small script to set/restore the user's theme ASAP */}
|
||||
<ThemeScript />
|
||||
<ThemeScript {...{ themeClassNames, themeStorageKey }} />
|
||||
|
||||
{/* preload highest priority fonts defined in ../lib/styles/fonts/ */}
|
||||
{preloadFonts.map((font) => (
|
||||
|
Reference in New Issue
Block a user