Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/components/Head.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import PageOrder from "astro-vtbot/components/starlight/PageOrder.astro";
import { pwaInfo } from "virtual:pwa-info";
---

<script is:inline>
(() => {
const storedTheme = localStorage.getItem("starlight-theme");
const theme = storedTheme || (matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark");
document.documentElement.dataset.theme = theme === "light" ? "light" : "dark";
})();
</script>

<script>
import { registerSW } from "virtual:pwa-register";
// 每10分钟检查一次更新,页面将自动刷新
Expand Down
Loading