Skip to content

Commit 6f8882a

Browse files
authored
Merge branch 'main' into test/verify-cache-for-empty-string-keys-2
2 parents 74dbfab + 0b36178 commit 6f8882a

2 files changed

Lines changed: 1795 additions & 284 deletions

File tree

app/layout.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,26 @@ export const metadata: Metadata = {
6666

6767
export 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 />

0 commit comments

Comments
 (0)