Set correct theme color after page is loaded

This commit is contained in:
Jimmy Zhang 2019-04-24 20:55:03 +08:00
parent ffcb30ab07
commit afeec1d7f2
1 changed files with 1 additions and 0 deletions

View File

@ -7,6 +7,7 @@ var metaThemeColor = document.querySelector("meta[name=theme-color]");
if (getTheme !== null) {
document.body.classList.toggle("dark-theme", isDark);
isDark ? metaThemeColor.setAttribute("content", "#252627") : metaThemeColor.setAttribute("content", "#fafafa");
}
themeToggle.addEventListener("click", () => {