aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/themeSwitcher.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/themeSwitcher.html')
-rw-r--r--layouts/partials/themeSwitcher.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/partials/themeSwitcher.html b/layouts/partials/themeSwitcher.html
index 902d8e3..9781878 100644
--- a/layouts/partials/themeSwitcher.html
+++ b/layouts/partials/themeSwitcher.html
@@ -1,15 +1,15 @@
<script>
function setTheme() {
const themeName = document.getElementById('themes').value;
- localStorage.setItem('theme', themeName);
document.documentElement.className = themeName;
+ localStorage.setItem('theme', themeName);
}
(function () { // Set the theme on page load
+ const elt = document.getElementById('themes');
+ elt.style.display = 'block';
const themeName = localStorage.getItem('theme');
if (themeName) {
document.documentElement.className = themeName;
- const elt = document.getElementById('themes');
- elt.style.display = "block";
elt.value = themeName;
}
})();