summaryrefslogtreecommitdiff
path: root/public/static/js/theme.min.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/static/js/theme.min.js')
-rw-r--r--public/static/js/theme.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/public/static/js/theme.min.js b/public/static/js/theme.min.js
new file mode 100644
index 0000000..975a76e
--- /dev/null
+++ b/public/static/js/theme.min.js
@@ -0,0 +1 @@
+var validThemes=["dark.min","light.min"],currentTheme=localStorage.getItem("theme");function toggleTheme(){currentTheme="dark.min"===currentTheme?"light.min":"dark.min",localStorage.setItem("theme",currentTheme),addStyleSheet(currentTheme,"theme")}validThemes.includes(currentTheme)||(currentTheme=window.matchMedia("(prefers-color-scheme: dark").matches?"dark.min":"light.min"),addStyleSheet(currentTheme,"theme");