1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-06-30 21:46:39 -04:00

use camelCase in themes config

This commit is contained in:
2022-02-28 20:07:27 -05:00
parent 324a15aa6a
commit 33c02d205e
5 changed files with 64 additions and 52 deletions

View File

@ -3,7 +3,7 @@ import { useTheme } from "next-themes";
import classNames from "classnames";
import Header from "../Header/Header";
import Footer from "../Footer/Footer";
import themes, { toCSS } from "../../lib/config/themes";
import themes from "../../lib/config/themes";
import styles from "./Layout.module.css";
@ -18,16 +18,8 @@ const Layout = ({ container = true, stickyHeader = true, className, children, ..
return (
<>
<Head>
{/* convert themes object into inlined css variables */}
<style
id="theme-colors"
dangerouslySetInnerHTML={{
__html: `:root{${toCSS(themes.light)}}[data-theme="dark"]{${toCSS(themes.dark)}}`,
}}
/>
{/* dynamically set browser theme color to match the background color; default to light for SSR */}
<meta name="theme-color" content={themes[resolvedTheme || "light"]["background-outer"]} />
<meta name="theme-color" content={themes[resolvedTheme || "light"].backgroundOuter} />
</Head>
<div className={classNames(styles.flex, className)} {...rest}>