Add Color Mode

This commit is contained in:
Lucian Petri
2022-12-29 18:40:09 +02:00
parent 71eb09b28a
commit 721012ab27
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -1,4 +1,6 @@
import { ColorModeScript } from "@chakra-ui/react";
import { Head, Html, Main, NextScript } from "next/document";
import theme from "../styles/Theme";
export default function Document() {
return (
@@ -7,6 +9,7 @@ export default function Document() {
<link rel="shortcut icon" type="image/png" href="/images/logos/favicon.png" />
</Head>
<body className="flex h-full flex-col bg-gray-50">
<ColorModeScript initialColorMode={theme.config.initialColorMode} />
<Main />
<NextScript />
</body>
+10
View File
@@ -0,0 +1,10 @@
import { extendTheme, type ThemeConfig } from "@chakra-ui/react";
const config: ThemeConfig = {
initialColorMode: "light",
useSystemColorMode: true,
};
const theme = extendTheme({ config });
export default theme;