mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-04 10:11:46 +03:00
fix(webui): keep iOS PWA controls inside safe area (#5477)
* fix(webui): keep iOS PWA controls inside safe area * fix(webui): blend iOS PWA chrome into dark canvas * fix(webui): sync PWA chrome with app theme
This commit is contained in:
@@ -25,6 +25,13 @@ function applyTheme(theme: Theme): void {
|
||||
const root = document.documentElement;
|
||||
if (theme === "dark") root.classList.add("dark");
|
||||
else root.classList.remove("dark");
|
||||
|
||||
const themeColor = document.querySelector<HTMLMetaElement>('meta[name="theme-color"]');
|
||||
const color =
|
||||
theme === "dark"
|
||||
? themeColor?.dataset.themeColorDark
|
||||
: themeColor?.dataset.themeColorLight;
|
||||
if (themeColor && color) themeColor.content = color;
|
||||
}
|
||||
|
||||
export function useTheme(): {
|
||||
|
||||
Reference in New Issue
Block a user