fix: sync PWA status bar theme-color with app color scheme (#28006)

This commit is contained in:
黑墨水鱼 2026-05-18 08:12:02 +08:00 committed by GitHub
commit 71b27a1b0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 8 additions and 4 deletions

View file

@ -147,6 +147,10 @@ function applyThemeCss(theme: DesktopTheme, themeId: string, mode: "light" | "da
ensureThemeStyleElement().textContent = fullCss
document.documentElement.dataset.theme = themeId
document.documentElement.dataset.colorScheme = mode
// Update theme-color meta tag to match light/dark mode
const meta = document.querySelector('meta[name="theme-color"]')
if (meta) meta.setAttribute("content", isDark ? "#131010" : "#F8F7F7")
}
function cacheThemeVariants(theme: DesktopTheme, themeId: string) {