Skip to content

Commit 48f17bf

Browse files
committed
fix: improved base layout with new elements
1 parent be0a7dc commit 48f17bf

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/layouts/BaseLayout.astro

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
11
---
22
import '@/styles/global.css';
3+
import '@/assets/fonts/inter.css';
4+
import BannerFloat from '@/components/BannerFloat.astro';
5+
import Header from '@/components/partials/Header.astro';
6+
import Footer from '@/components/partials/Footer.astro';
7+
import SwitchTheme from '@/components/SwitchTheme.tsx';
38
---
49

5-
<html lang="en" class="dark">
10+
<html lang="en">
611
<head>
712
<meta charset="utf-8" />
813
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
914
<meta name="viewport" content="width=device-width" />
1015
<meta name="generator" content={Astro.generator} />
1116
<title>Astro</title>
17+
<script is:inline>
18+
// Prevent FOUC by applying theme before page renders
19+
(function() {
20+
const theme = localStorage.getItem('theme') ||
21+
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
22+
if (theme === 'dark') {
23+
document.documentElement.classList.add('dark');
24+
}
25+
})();
26+
</script>
1227
</head>
13-
<body class="bg-background text-foreground">
28+
<body class="bg-background text-foreground py-8 pb-12">
29+
<Header />
1430
<main>
1531
<slot />
1632
</main>
33+
<Footer />
34+
<SwitchTheme client:load />
35+
<BannerFloat />
1736
</body>
1837
</html>

0 commit comments

Comments
 (0)