default dark mode to the user's color scheme
All checks were successful
Web/pipeline/head This commit looks good

This commit is contained in:
Ell 2021-11-11 03:18:40 +01:00
parent 1be224b23d
commit 4aebe9542b

View file

@ -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)
addStyle("/style/dark.css");