summaryrefslogtreecommitdiff
path: root/layouts/partials/footer.html
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-11-03 20:05:21 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-11-03 20:07:59 +0530
commit0eed773e6dcf999cb052b6f781bfbe7ad74e63c7 (patch)
tree21f623ef7f628df5c1049490c8813cd6cee787ee /layouts/partials/footer.html
parent229df19ec9b535ea1ec3403c01e1e7db287c5d0d (diff)
theme-switch-button: improve logic
- owner can set dark/light/auto default theme - theme toggle will be enabled on all theme modes unless disbaled - if disableThemeToggle is true, user won't be able to switch themes, here auto (a/c to system theme) also works for #69
Diffstat (limited to 'layouts/partials/footer.html')
-rw-r--r--layouts/partials/footer.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index f3baf82..dbc4989 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -50,7 +50,7 @@
localStorage.setItem("menu-scroll-position", document.getElementById('menu').scrollLeft);
}
</script>
-{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }}
+{{- if (and (not .Site.Params.disableThemeToggle) (not (eq .Site.Params.defaultTheme "auto"))) }}
<script>
document.getElementById("theme-toggle").addEventListener("click", () => {
if (document.body.className.includes("dark")) {