aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/app.js b/src/app.js
index 267c18e..cb6a030 100644
--- a/src/app.js
+++ b/src/app.js
@@ -386,7 +386,14 @@ function resolvedTheme() {
return 'light';
}
function applyTheme() {
- try { document.documentElement.dataset.theme = resolvedTheme(); } catch {}
+ try {
+ const th = resolvedTheme();
+ document.documentElement.dataset.theme = th;
+ // the browser's status bar (a PWA, or the Android app) takes its colour
+ // from here: the page background in light, the dark theme colour in dark
+ const meta = document.querySelector('meta[name="theme-color"]');
+ if (meta) meta.setAttribute('content', th === 'dark' ? '#15171a' : '#eef0f3');
+ } catch {}
}
function toggleTheme() {
try { localStorage.setItem(THEME_KEY, resolvedTheme() === 'dark' ? 'light' : 'dark'); } catch {}