added dark/light mode and control

This commit is contained in:
Hunter W.
2026-03-27 13:01:56 -04:00
parent 8bc880fe10
commit 84a6fe4376
7 changed files with 212 additions and 43 deletions

View File

@@ -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>
);
}