File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,8 +66,26 @@ export const metadata: Metadata = {
6666
6767export default function RootLayout ( { children } : { children : React . ReactNode } ) {
6868 return (
69- < html lang = "en" >
70- < body className = { `${ inter . className } bg-black` } >
69+ < html lang = "en" suppressHydrationWarning >
70+ < head >
71+ < script
72+ dangerouslySetInnerHTML = { {
73+ __html : `
74+ try {
75+ const storedTheme = window.localStorage.getItem('theme');
76+ if (storedTheme === 'light') {
77+ document.documentElement.classList.remove('dark');
78+ document.documentElement.style.colorScheme = 'light';
79+ } else {
80+ document.documentElement.classList.add('dark');
81+ document.documentElement.style.colorScheme = 'dark';
82+ }
83+ } catch (_) {}
84+ ` ,
85+ } }
86+ />
87+ </ head >
88+ < body className = { inter . className } >
7189 < ScrollRestoration />
7290 < BrandParticles />
7391 < Navbar />
You can’t perform that action at this time.
0 commit comments