feat: implements next-themes

Adds `next-themes` to allow users to switch between light and dark themes.
This commit is contained in:
Maximilian Liebmann 2025-05-09 17:37:11 +02:00
parent b81210d2ea
commit a56b6829a2
6 changed files with 34 additions and 6 deletions

View file

@ -1,3 +1,5 @@
import { ThemeProvider } from '@/components/theme-provider';
import type { Metadata } from 'next';
import './globals.css';
@ -12,8 +14,17 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang='en'>
<body>{children}</body>
<html lang='en' suppressHydrationWarning>
<body>
<ThemeProvider
attribute='class'
defaultTheme='system'
enableSystem
disableTransitionOnChange
>
{children}
</ThemeProvider>
</body>
</html>
);
}