feat: make colors configurable
This commit is contained in:
committed by
Mathias Schopmans
parent
f7e36ddc9d
commit
e1386c0385
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user