diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 779cd697..90cbeec0 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -64,11 +64,5 @@
}
})
-
-{{- else -}}
-{{/* case where owner disables theme button after deployment, this resets the stored theme */}}
-
{{- end }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index c68db5c2..0066a795 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,26 +1,23 @@
+{{- /* theme-toggle is enabled */}}
+{{- if (not .Site.Params.disableThemeToggle) }}
+{{- /* theme is light */}}
{{- if (eq .Site.Params.defaultTheme "light") }}
+{{- /* theme is dark */}}
{{- else if (eq .Site.Params.defaultTheme "dark") }}
-{{- else if (or (eq .Site.Params.defaultTheme "auto") (not .Site.Params.disableThemeToggle) ) }}
+{{- else }}
+{{- /* theme is auto */}}
+{{- end }}
+{{- /* theme-toggle is disabled and theme is auto */}}
+{{- else if (and (ne .Site.Params.defaultTheme "light") (ne .Site.Params.defaultTheme "dark"))}}
+
{{- end }}