1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-29 23:05:59 -04:00

restore live theme switching when system setting changes

TODO: removing the event listener is infuriatingly not cooperating
This commit is contained in:
2021-12-16 09:25:47 -05:00
parent 2377fbfdf2
commit fe1a10d437
2 changed files with 16 additions and 7 deletions
-4
View File
@@ -14,8 +14,4 @@ try {
cl.remove("light");
cl.add("dark");
}
// TODO: fix real-time switching (works but bulb icon isn't updated)
// window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => e.matches && setDark(true));
// window.matchMedia("(prefers-color-scheme: light)").addEventListener("change", (e) => e.matches && setDark(false));
} catch (error) {}