-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy pathMainLayout.astro
78 lines (66 loc) · 2.18 KB
/
MainLayout.astro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
import { ViewTransitions } from "astro:transitions";
import SideNav from "../components/SideNav.astro";
import TopNav from "../components/TopNav.astro";
import Footer from "../components/Footer.astro";
---
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&family=Overpass:ital,wght@0,300;0,400;0,600;0,800;1,400&display=swap"
rel="stylesheet"
/>
<title>SvelteFire Documentation</title>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<link rel="preconnect" href="https://FPK5SXN3GJ-dsn.algolia.net" crossorigin />
<ViewTransitions />
</head>
<body class="dark:bg-gray6 dark:text-white transition-colors duration-500">
<TopNav />
<div class="relative flex items-stretch overflow-x-hidden">
<SideNav />
<main
class="max-w-screen-2xl min-h-screen p-6 lg:p-20 mx-auto prose dark:prose-invert w-full flex flex-col justify-between"
>
<article>
<slot />
</article>
<Footer />
</main>
</div>
<script>
function colorMode() {
if (
localStorage.theme === "dark" ||
(!("theme" in localStorage) &&
window.matchMedia("(prefers-color-scheme: dark)").matches)
) {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");
}
}
colorMode();
document.addEventListener('astro:beforeload', colorMode);
</script>
</body>
</html>
<style is:global>
.DocSearch-Button {
@apply flex items-center justify-center px-0;
}
.DocSearch-Button:hover, .DocSearch-Button:focus {
@apply shadow-none bg-transparent text-gray4;
}
.DocSearch-Search-Icon path {
@apply stroke-gray4;
}
.DocSearch-Button-Placeholder {
@apply font-code lowercase ml-2;
}
</style>