feat(theme): persistent light/dark toggle in the titlebar

This commit is contained in:
pj committed 2026-06-20 18:46:43 -04:00
1 parent a5b3c0c0e3
commit 9991d318ba
5 files changed
+61 -3

No files matched your search

+10
View File
@@ -4,6 +4,16 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="/margin-mark.png" />
<script>
(function () {
try {
var t = localStorage.getItem("margin-theme");
if (t !== "light" && t !== "dark")
t = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
document.documentElement.setAttribute("data-theme", t);
} catch (e) {}
})();
</script>
<title>margin</title>
</head>
<body>