Fix for theme switcher when isDarkOS is true (#2)
This commit is contained in:
committed by
Vasily Zubarev
parent
9b2ec406b2
commit
7880550595
@@ -13,7 +13,7 @@ function initializeThemeSwitcher() {
|
||||
|
||||
const isDarkOS = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
const theme = localStorage.getItem("theme");
|
||||
if (theme === "dark" || isDarkOS) {
|
||||
if ((theme === "dark" || isDarkOS) && theme !== "light") {
|
||||
document.body.className = "dark-theme";
|
||||
themeSwitch.checked = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user