1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 17:46:39 -04:00

fontsource -> next/font

This commit is contained in:
2022-10-28 09:26:01 -04:00
parent 840e73b49a
commit 6520e6fa2e
11 changed files with 45 additions and 232 deletions

View File

@ -1,7 +1,6 @@
import { Html, Head, Main, NextScript } from "next/document";
import ThemeScript from "../components/ThemeScript";
import { getCssText, themeClassNames, themeStorageKey } from "../lib/styles/stitches.config";
import { Inter, RobotoMono } from "../lib/styles/fonts";
import * as config from "../lib/config";
// https://nextjs.org/docs/advanced-features/custom-document
@ -12,11 +11,6 @@ const Document = () => {
{/* inject a small script to set/restore the user's theme ASAP */}
<ThemeScript id="restore-theme" {...{ themeClassNames, themeStorageKey }} />
{/* preload highest priority fonts defined in ../lib/styles/fonts/ */}
{[...Inter.preloads, ...RobotoMono.preloads].map(({ href, type }) => (
<link key={href} rel="preload" as="font" {...{ type, href }} crossOrigin="anonymous" />
))}
<style id="stitches" dangerouslySetInnerHTML={{ __html: getCssText() }} />
</Head>
<body>