feat: make colors configurable

This commit is contained in:
Mathias Schopmans
2024-03-04 15:16:47 +01:00
committed by Mathias Schopmans
parent f7e36ddc9d
commit e1386c0385
9 changed files with 36 additions and 12 deletions

View File

@@ -1,8 +1,22 @@
import { Head, Html, Main, NextScript } from "next/document";
import { CSSProperties, useMemo } from "react";
import { getColors } from "@/lib/data";
export default function Document() {
const style = useMemo(() => {
const cssVariables: Record<string, any> = {};
const colors = getColors();
Object.entries(colors).forEach(([key, value]) => {
cssVariables[`--${key}`] = value;
});
return cssVariables as CSSProperties;
}, []);
return (
<Html lang="en">
<Html lang="en" style={style}>
<Head />
<body>
<Main />