summaryrefslogtreecommitdiff
path: root/static/js/theme-switch.js
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2025-08-04 20:51:59 +0200
committerMartin Fischer <martin@push-f.com>2025-08-16 20:52:57 +0200
commit3cada41922abb83b5a5541e4b5efd3fc1659c483 (patch)
tree63ee2be103394520d78521b12b1711d4968b0cc1 /static/js/theme-switch.js
parentf5613007297731d12f65ef81e1abacafe1f38cec (diff)
fix: enable dark theme via CSS
Diffstat (limited to 'static/js/theme-switch.js')
-rw-r--r--static/js/theme-switch.js28
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();