From 3cada41922abb83b5a5541e4b5efd3fc1659c483 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 4 Aug 2025 20:51:59 +0200 Subject: fix: enable dark theme via CSS --- static/js/theme-switch.js | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 static/js/theme-switch.js (limited to 'static') diff --git a/static/js/theme-switch.js b/static/js/theme-switch.js deleted file mode 100644 index a617fda..0000000 --- a/static/js/theme-switch.js +++ /dev/null @@ -1,28 +0,0 @@ -function isAuto() { - return document.body.classList.contains("auto"); -} - -function setTheme() { - if (!isAuto()) { - return - } - - document.body.classList.remove("auto"); - let cls = "light"; - if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { - cls = "dark"; - } - - document.body.classList.add(cls); -} - -function invertBody() { - document.body.classList.toggle("dark"); - document.body.classList.toggle("light"); -} - -if (isAuto()) { - window.matchMedia('(prefers-color-scheme: dark)').addListener(invertBody); -} - -setTheme(); -- cgit v1.2.3