fix: merge pull request #80 from brian6932/fix/prefers-color-scheme

fix: prefers-color-scheme
This commit is contained in:
Achraf RRAMI 2024-12-28 10:19:08 +00:00 committed by GitHub
commit 9e307b7da4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,7 +76,7 @@ function getAnnotation(e) {
};
}
window._currentTheme = localStorage.getItem("_theme") || "light";
window._currentTheme = localStorage.getItem("_theme") || (window.matchMedia("(prefers-color-scheme:dark)").matches ? "dark" : "light");
setTheme(window._currentTheme);
const themeChooser = document.getElementById("choose-theme");