Update src/app/layout.tsx

This commit is contained in:
2026-03-06 05:50:43 +00:00
parent 59e0438066
commit bbf5fa93ec

View File

@@ -16,6 +16,20 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<head>
<script
dangerouslySetInnerHTML={{
__html: `
(function() {
const theme = localStorage.getItem('theme');
if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark');
}
})();
`,
}}
/>
</head>
<body className={inter.className}>
{children}