feat: add basic theming setup

This commit is contained in:
Aidan 2025-04-24 21:05:30 -04:00
parent cce43e768b
commit 370521fbc0
3 changed files with 22 additions and 2 deletions

View File

@ -16,6 +16,7 @@
"clsx": "^2.1.1",
"lucide-react": "^0.503.0",
"next": "15.3.1",
"next-themes": "^0.4.6",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"tailwind-merge": "^3.2.0"

View File

@ -1,6 +1,7 @@
import type { Metadata } from "next"
import { Space_Mono } from "next/font/google"
import "./globals.css"
import { ThemeProvider } from "@/components/ThemeProvider"
const spaceMono = Space_Mono({
variable: "--font-space-mono",
@ -19,11 +20,18 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<body
className={`${spaceMono.variable} antialiased`}
>
{children}
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
{children}
</ThemeProvider>
</body>
</html>
)

View File

@ -0,0 +1,11 @@
"use client"
import * as React from "react"
import { ThemeProvider as NextThemesProvider } from "next-themes"
export function ThemeProvider({
children,
...props
}: React.ComponentProps<typeof NextThemesProvider>) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
}