Make theme key accessible via CSS

This commit is contained in:
Svilen Markov
2025-05-16 03:09:20 +01:00
parent a6382b2e1d
commit b294839b79
2 changed files with 2 additions and 1 deletions

View File

@@ -683,6 +683,7 @@ async function changeTheme(key, onChanged) {
.appendTo(document.head);
themeStyleElem.html(newThemeStyle);
document.documentElement.setAttribute("data-theme", key);
document.documentElement.setAttribute("data-scheme", response.headers.get("X-Scheme"));
typeof onChanged == "function" && onChanged();
setTimeout(() => { tempStyle.remove(); }, 10);