Enable dark mode
This commit is contained in:
parent
b3e6533748
commit
dcd3857c80
26 changed files with 410 additions and 220 deletions
13
src/app.html
13
src/app.html
|
|
@ -4,6 +4,19 @@
|
|||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="text-scale" content="scale" />
|
||||
<script>
|
||||
// Apply theme before first paint to avoid a light-on-dark flash.
|
||||
(function () {
|
||||
try {
|
||||
var t = localStorage.getItem("squalk:theme");
|
||||
var dark =
|
||||
t === "dark" ||
|
||||
(t !== "light" &&
|
||||
window.matchMedia("(prefers-color-scheme: dark)").matches);
|
||||
if (dark) document.documentElement.classList.add("dark");
|
||||
} catch (e) {}
|
||||
})();
|
||||
</script>
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue