Skip to content

Commit b91de50

Browse files
committed
feat: 다크모드 초기 색상 지정
1 parent 3021ccd commit b91de50

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

app/layout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ export default async function RootLayout({
5757
const categories = getCategories();
5858

5959
return (
60-
<html lang="en">
60+
<html lang="en" suppressHydrationWarning>
61+
<head>
62+
<script
63+
dangerouslySetInnerHTML={{
64+
__html: `(function(){try{var c=document.cookie.match(/(?:^|; )theme=([^;]*)/);if(c&&c[1]==='dark'){var d=document.documentElement;d.classList.add('dark');d.style.backgroundColor='oklch(0.145 0 0)'}}catch(e){}})()`,
65+
}}
66+
/>
67+
</head>
6168
<body
6269
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
6370
>

0 commit comments

Comments
 (0)