1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-17 19:05:32 -04:00

clean up stitches theme config

This commit is contained in:
2022-07-07 16:19:28 -04:00
parent b1a92a2eab
commit 295301aa9e
7 changed files with 29 additions and 32 deletions

View File

@@ -2,12 +2,12 @@ import { createStitches } from "@stitches/react";
// misc. helpers
import hexToRgba from "hex-to-rgba";
import normalizeStyles from "./helpers/normalize";
import normalizeStyles from "./utils/normalize";
// web fonts
import { Inter, RobotoMono } from "./fonts";
export const { styled, css, getCssText, globalCss, keyframes, createTheme, theme, config } = createStitches({
export const { styled, css, getCssText, globalCss, keyframes, createTheme, theme, config, reset } = createStitches({
theme: {
fonts: {
sans: `"${Inter.name.regular}", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,
@@ -165,5 +165,14 @@ export const globalStyles = globalCss(
}
);
// theme classnames are generated dynamically by stitches, so have ThemeProvider pull them from there
export const themeClassNames = {
light: theme.className,
dark: darkTheme.className,
};
// local storage key
export const themeStorageKey = "theme";
// re-export hashed URLs of the most important variable fonts so we can preload them in pages/_document.tsx
export const preloadFonts = [...Inter.preloadFonts, ...RobotoMono.preloadFonts];