diff options
author | Martin Fischer <martin@push-f.com> | 2025-08-04 20:51:59 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2025-08-16 20:52:57 +0200 |
commit | 3cada41922abb83b5a5541e4b5efd3fc1659c483 (patch) | |
tree | 63ee2be103394520d78521b12b1711d4968b0cc1 /static | |
parent | f5613007297731d12f65ef81e1abacafe1f38cec (diff) |
fix: enable dark theme via CSS
Diffstat (limited to 'static')
-rw-r--r-- | static/js/theme-switch.js | 28 |
1 files changed, 0 insertions, 28 deletions
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(); |