Skip to content

Commit

Permalink
Refactor ThemeMenu to set icon theme based on system preference
Browse files Browse the repository at this point in the history
  • Loading branch information
madalinpopa committed Sep 29, 2024
1 parent ce0ded9 commit 39599ca
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/components/navigation/ThemeMenu.astro
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ import { Icon } from "astro-icon/components";
localStorage.removeItem("theme");
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
document.documentElement.classList.add("dark");
localStorage.theme = "dark";
} else {
document.documentElement.classList.remove("dark");
localStorage.theme = "light";
}
}
this.theme = newTheme;
Expand Down

0 comments on commit 39599ca

Please sign in to comment.