Skip to content

Commit e3d4ac6

Browse files
committed
TO MAIN
1 parent a6547e6 commit e3d4ac6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/layouts/BaseLayout.astro

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ const { title, description, ogImage } = Astro.props as BaseLayoutProps;
1212
---
1313

1414
<!doctype html>
15-
<html lang=`${LOCALE.lang ?? "en"}` class="scroll-smooth">
15+
<html lang={`${LOCALE.lang ?? "en"}`} class="scroll-smooth">
1616
<head>
1717
<HeadSEO
18-
title=`${title ? capitalizeFirstLetter(title) : SITE.title}`
18+
title={`${title ? capitalizeFirstLetter(title) : SITE.title}`}
1919
description={description}
2020
ogImage={ogImage}
2121
/>
22+
<script>
23+
const savedTheme = localStorage.getItem('theme') || 'dark';
24+
document.documentElement.setAttribute('data-theme', savedTheme);
25+
</script>
2226
</head>
23-
<body class="bg-background text-foreground font-sans">
27+
<body class="bg-background text-foreground font-sans" data-theme="dark">
2428
<div class="flex flex-col min-h-screen">
2529
<Header class="bg-background" />
2630
<main class="flex flex-1 flex-col justify-center items-center px-4">

0 commit comments

Comments
 (0)