diff --git a/darkfx/styles/toggle-theme.js b/darkfx/styles/toggle-theme.js index 6146cc5..bfa33c2 100644 --- a/darkfx/styles/toggle-theme.js +++ b/darkfx/styles/toggle-theme.js @@ -1,6 +1,6 @@ const sw = document.getElementById("switch-style"), b = document.body; if (sw && b) { - sw.checked = window.localStorage && localStorage.getItem("theme") === "dark-theme" || !window.localStorage; + sw.checked = !window.localStorage || !window.localStorage.getItem("theme") || window.localStorage && localStorage.getItem("theme") === "dark-theme"; b.classList.toggle("dark-theme", sw.checked) b.classList.toggle("light-theme", !sw.checked)