added dark/light mode and control
This commit is contained in:
@@ -2,6 +2,8 @@ import type { Metadata } from "next";
|
||||
import { JetBrains_Mono, DM_Sans } from "next/font/google";
|
||||
import { SITE } from "@/data/content";
|
||||
import "./globals.css";
|
||||
import { ThemeProvider } from 'next-themes'
|
||||
import ThemeSwitch from "@/components/ThemeSwitch";
|
||||
|
||||
const mono = JetBrains_Mono({
|
||||
subsets: ["latin"],
|
||||
@@ -26,8 +28,14 @@ export default function RootLayout({
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<html lang="en" className={`${mono.variable} ${sans.variable}`}>
|
||||
<body>{children}</body>
|
||||
<html lang="en" className={`${mono.variable} ${sans.variable}`} suppressHydrationWarning>
|
||||
<head />
|
||||
<body>
|
||||
<ThemeProvider attribute="data-theme">
|
||||
<ThemeSwitch/>
|
||||
{children}
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user