aboutsummaryrefslogtreecommitdiff
path: root/public/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'public/index.html')
-rw-r--r--public/index.html7
1 files changed, 5 insertions, 2 deletions
diff --git a/public/index.html b/public/index.html
index 1781510..adf7737 100644
--- a/public/index.html
+++ b/public/index.html
@@ -19,10 +19,13 @@
<!-- Set initial theme the theme -->
<script>
- if ("theme" in localStorage)
+ if ("theme" in localStorage) {
document.documentElement.setAttribute('data-theme', localStorage.theme)
- else if (window.matchMedia('(prefers-color-scheme: dark)').matches)
+ }
+ else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
localStorage.theme = 'dark'
+ document.documentElement.setAttribute('data-theme', 'dark')
+ }
else
localStorage.theme = 'light'
</script>