feat: reactive title bar based on user's theme

Fixes #2139
This commit is contained in:
rramiachraf 2023-03-03 13:48:11 +01:00
parent acff16a8d4
commit 001f2917f6
2 changed files with 7 additions and 0 deletions

View file

@ -34,6 +34,12 @@ export default {
if (themePref == "auto") this.theme = darkModePreference.matches ? "dark" : "light";
else this.theme = themePref;
// Change title bar color to white
if (this.theme === "light") {
const themeColor = document.querySelector("meta[name='theme-color']");
themeColor.setAttribute("content", "#FFF");
}
// Used for the scrollbar
const root = document.querySelector(":root");
this.theme == "dark" ? root.classList.add("dark") : root.classList.remove("dark");