aboutsummaryrefslogtreecommitdiff
path: root/static/js/theme.js
diff options
context:
space:
mode:
authorJieiku2023-05-22 23:24:44 -0700
committerJieiku2023-05-22 23:24:44 -0700
commit3af6d9131f6dfc138856d718ec96626344095ec8 (patch)
tree1a8d75cf494d5333da2cb02506e04c9e0f576f6d /static/js/theme.js
parent3ca36cc469e838cee7d3fdcdc6ff39b35313a293 (diff)
downloadabridge-3af6d9131f6dfc138856d718ec96626344095ec8.tar.gz
abridge-3af6d9131f6dfc138856d718ec96626344095ec8.tar.bz2
abridge-3af6d9131f6dfc138856d718ec96626344095ec8.zip
Optimizations and Fixes
Diffstat (limited to 'static/js/theme.js')
-rw-r--r--static/js/theme.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/static/js/theme.js b/static/js/theme.js
new file mode 100644
index 0000000..5f6f0f6
--- /dev/null
+++ b/static/js/theme.js
@@ -0,0 +1,4 @@
+// enforce local storage setting but also fallback to user-agent preferences
+if (localStorage.getItem('theme') === 'light' || (!localStorage.getItem('theme') && !window.matchMedia("(prefers-color-scheme: dark)").matches)) {
+ document.documentElement.classList.add('light');
+}