T45a Site · Stack: reloads open in the current mode, the first paint keeps the system's, plain route changes
This commit is contained in:
1 parent
167055fdae
commit
3ae04f4ead
7 files changed
+14
-19
No files matched your search
+9
-6
@@ -4,10 +4,10 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Ely · GPUI components</title>
|
||||
<meta name="description" content="A component library for GPUI, in light and dark. Every component runs live in the browser." />
|
||||
<meta name="description" content="A component library for GPUI, in light and dark. Its stories run live in the browser, or as native captures where a browser cannot run them." />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="Ely · GPUI components" />
|
||||
<meta property="og:description" content="A component library for GPUI. Every part runs live in the browser, compiled from Rust to WebAssembly." />
|
||||
<meta property="og:description" content="A component library for GPUI, its stories live in the browser, compiled from Rust to WebAssembly." />
|
||||
<meta property="og:image" content="https://ely-site.zhangyanghaha0407.workers.dev/og.png" />
|
||||
<meta property="og:image:width" content="2400" />
|
||||
<meta property="og:image:height" content="1260" />
|
||||
@@ -15,11 +15,14 @@
|
||||
<meta name="twitter:image" content="https://ely-site.zhangyanghaha0407.workers.dev/og.png" />
|
||||
<script>
|
||||
// The saved mode, or the system's, before first paint.
|
||||
let saved = null;
|
||||
try {
|
||||
const saved = localStorage.getItem("ely-theme");
|
||||
const dark = saved ? saved === "dark" : matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
document.documentElement.classList.toggle("dark", dark);
|
||||
} catch {}
|
||||
saved = localStorage.getItem("ely-theme");
|
||||
} catch (error) {
|
||||
console.warn("theme: no saved mode", error);
|
||||
}
|
||||
const dark = saved ? saved === "dark" : matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
document.documentElement.classList.toggle("dark", dark);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in new issue
Block a user