fix: pwa color

This commit is contained in:
hamster1963
2024-12-02 23:12:55 +08:00
parent 59ec052374
commit 66b474c5de
3 changed files with 19 additions and 1 deletions

View File

@@ -40,10 +40,18 @@ export function ThemeProvider({
: "light";
root.classList.add(systemTheme);
const themeColor = systemTheme === "dark" ? "#242424" : "#fafafa";
document
.querySelector('meta[name="theme-color"]')
?.setAttribute("content", themeColor);
return;
}
root.classList.add(theme);
const themeColor = theme === "dark" ? "#242424" : "#fafafa";
document
.querySelector('meta[name="theme-color"]')
?.setAttribute("content", themeColor);
}, [theme]);
const value = {