diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-06-01 17:39:36 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-06-01 17:39:36 +0200 |
commit | e98fdc31873a567bd96fe64d0c8fe2416d4a610d (patch) | |
tree | 0a6974ab07cd141c700bbf086c5055e99b71b143 /share/html_start | |
parent | 047aab9d5821a7802af3e1dfda324ae9e0842c05 (diff) |
html_start: there is no theme switcher, so no need to use localstorage
Diffstat (limited to 'share/html_start')
-rw-r--r-- | share/html_start | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/share/html_start b/share/html_start index 68be715..c44b353 100644 --- a/share/html_start +++ b/share/html_start @@ -16,21 +16,8 @@ old.href = path; } } - var otherTheme = { - 'dark': 'light', - 'light': 'dark', - }; - var currentTheme = localStorage.getItem('theme'); - if (!otherTheme.hasOwnProperty(currentTheme)) { - currentTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; - } + const currentTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; addStyleSheet(currentTheme, 'theme'); - - function toggleTheme() { - currentTheme = otherTheme[currentTheme] || 'light'; - localStorage.setItem('theme', currentTheme); - addStyleSheet(currentTheme, 'theme'); - } </script> <script src=".data/js/glightbox.min.js"></script> </head> |