default dark mode to the user's color scheme
All checks were successful
Web/pipeline/head This commit looks good
All checks were successful
Web/pipeline/head This commit looks good
This commit is contained in:
parent
1be224b23d
commit
4aebe9542b
1 changed files with 2 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
const dark = getCookie("dark") === "true";
|
const darkCookie = getCookie("dark");
|
||||||
|
const dark = darkCookie == undefined ? window.matchMedia("(prefers-color-scheme: dark)").matches : darkCookie == "true";
|
||||||
if (dark)
|
if (dark)
|
||||||
addStyle("/style/dark.css");
|
addStyle("/style/dark.css");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue