1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 13:18:26 -04:00

don't set theme-color until we know for sure what the resolvedTheme is

This commit is contained in:
Jake Jarvis 2022-01-08 11:32:43 -05:00
parent ce39750b0b
commit b7313985db
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
2 changed files with 11 additions and 6 deletions

View File

@ -2,7 +2,7 @@ import Head from "next/head";
import { useTheme } from "next-themes";
import Header from "./page-header/Header";
import Footer from "./page-footer/Footer";
import { themeColorLight, themeColorDark } from "../lib/config";
import { themeColors } from "../lib/config";
import styles from "./Layout.module.css";
@ -11,9 +11,11 @@ const Layout = ({ children }) => {
return (
<>
<Head>
<meta name="theme-color" content={resolvedTheme === "dark" ? themeColorDark : themeColorLight} />
</Head>
{resolvedTheme && (
<Head>
<meta name="theme-color" content={themeColors[resolvedTheme]} />
</Head>
)}
<Header />
<main className={styles.main}>

View File

@ -18,8 +18,11 @@ module.exports = {
fathomSiteId: "WBGNQUKW",
fathomCustomDomain: "https://blue-chilly.jarv.is",
webmentionId: "jarv.is",
themeColorLight: "#fcfcfc",
themeColorDark: "#252525",
themeColors: {
// used for `<meta name="theme-color" ...>`, should be the same as CSS `--background-outer` var in styles/colors.css
light: "#fcfcfc",
dark: "#252525",
},
// Me info
authorName: "Jake Jarvis",