feat: dark and light mdoe
This commit is contained in:
+7
-1
@@ -21,8 +21,14 @@ export default function RootLayout({
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<html lang="fa" dir="rtl">
|
||||
<html lang="fa" dir="rtl" suppressHydrationWarning>
|
||||
<head>
|
||||
{/* Apply the saved/system theme before paint to avoid a flash of the wrong theme */}
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `(function(){try{var t=localStorage.getItem('theme');var d=t?t==='dark':window.matchMedia('(prefers-color-scheme: dark)').matches;if(d)document.documentElement.classList.add('dark');}catch(e){}})();`,
|
||||
}}
|
||||
/>
|
||||
<meta
|
||||
name="google-site-verification"
|
||||
content="HIKgdf_siYdPxbJ2P1792opMprpxci_QjE-quk9kyi8"
|
||||
|
||||
Reference in New Issue
Block a user