Skip to content

Commit

Permalink
Default to dark theme
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
steffen-wilke committed May 30, 2021
1 parent 40428b9 commit 0c15c86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion darkfx/styles/toggle-theme.js
Original file line number Diff line number Diff line change
@@ -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)

Expand Down

0 comments on commit 0c15c86

Please sign in to comment.