cloudflare/kumo

Public

mirrored fromhttps://github.com/cloudflare/kumoAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dcc30c61f1ff301fa2f86d737fe9029352677b34

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

packages/kumo-docs-astro/src/layouts/BaseLayout.astro

59lines · modecode

1---
2import "../styles/global.css";
3
4interface Props {
5 title?: string;
6 description?: string;
7}
8
9const { title = "Kumo", description = "Kumo – a modern component library" } =
10 Astro.props;
11
12// Build info is injected via Vite define in astro.config.mjs
13// These are replaced at build time with actual values
14declare const __KUMO_VERSION__: string;
15declare const __DOCS_VERSION__: string;
16declare const __BUILD_COMMIT__: string;
17declare const __BUILD_DATE__: string;
18
19const kumoVersion = typeof __KUMO_VERSION__ !== "undefined" ? __KUMO_VERSION__ : "dev";
20const docsVersion = typeof __DOCS_VERSION__ !== "undefined" ? __DOCS_VERSION__ : "dev";
21const buildCommit = typeof __BUILD_COMMIT__ !== "undefined" ? __BUILD_COMMIT__ : "local";
22const buildDate = typeof __BUILD_DATE__ !== "undefined" ? __BUILD_DATE__ : new Date().toISOString();
23---
24
25<!doctype html>
26<html class="bg-kumo-elevated" lang="en">
27 <head>
28 <meta charset="utf-8" />
29 <meta name="viewport" content="width=device-width, initial-scale=1" />
30 <meta name="kumo-version" content={kumoVersion} />
31 <meta name="docs-version" content={docsVersion} />
32 <meta name="build-commit" content={buildCommit} />
33 <meta name="build-date" content={buildDate} />
34 <title>{title}</title>
35 <meta name="description" content={description} />
36 <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
37 <link rel="preconnect" href="https://fonts.googleapis.com" />
38 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
39 <link
40 rel="stylesheet"
41 href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=optional"
42 />
43 <script is:inline>
44 // Initialize theme from localStorage or system preference
45 // This runs immediately (blocking) to prevent flash of unstyled content
46 (function() {
47 const stored = localStorage.getItem("theme");
48 if (stored) {
49 document.documentElement.setAttribute("data-mode", stored);
50 } else if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
51 document.documentElement.setAttribute("data-mode", "dark");
52 }
53 })();
54 </script>
55 </head>
56 <body>
57 <slot />
58 </body>
59</html>
60