summaryrefslogtreecommitdiff
path: root/layouts/partials/header.html
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-11-03 20:21:10 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-11-03 20:21:10 +0530
commit12b6b132e4c24c80813b726bd7191c83a5aead05 (patch)
tree2025d025637ece88f35fb544d84c55777bd6b30f /layouts/partials/header.html
parent0eed773e6dcf999cb052b6f781bfbe7ad74e63c7 (diff)
Revert "theme-switch-button: improve logic"
This reverts commit 0eed773e6dcf999cb052b6f781bfbe7ad74e63c7.
Diffstat (limited to 'layouts/partials/header.html')
-rw-r--r--layouts/partials/header.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 2dc56a6..233587b 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,4 +1,4 @@
-{{- if (and (not .Site.Params.disableThemeToggle) (not (eq .Site.Params.defaultTheme "auto"))) }}
+{{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }}
<script>
// load memory
if (localStorage.getItem("pref-theme") === "dark") {
@@ -13,7 +13,7 @@
</script>
{{- end }}
-{{- if (eq .Site.Params.defaultTheme "auto") }}
+{{- if (and (.Site.Params.disableThemeToggle) (eq .Site.Params.defaultTheme "auto")) }}
<script>
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark');
@@ -41,7 +41,7 @@
{{- .Site.Params.label.text | default .Site.Title -}}
</a>
<span class="logo-switches">
- {{- if (not .Site.Params.disableThemeToggle) }}
+ {{- if (and (not .Site.Params.disableThemeToggle) (not (or (eq .Site.Params.defaultTheme "light") (eq .Site.Params.defaultTheme "dark")))) }}
<span class="theme-toggle">
<a id="theme-toggle" accesskey="t">
<svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"