feat: implements next-themes
Adds `next-themes` to allow users to switch between light and dark themes.
This commit is contained in:
parent
b81210d2ea
commit
a56b6829a2
6 changed files with 34 additions and 6 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue