Skip to content

Build your personal knowledge base with Trilium Notes

client/theming: include the current theme ID as an attribute on the body element

Adorian Dorandfb44def2b57
diff --git a/apps/client/src/widgets/containers/root_container.ts b/apps/client/src/widgets/containers/root_container.ts
index ccc3e8a9a1..403ef01678 100644
--- a/apps/client/src/widgets/containers/root_container.ts
+++ b/apps/client/src/widgets/containers/root_container.ts
@@ -73,8 +73,9 @@ export default class RootContainer extends FlexContainer<BasicWidget> {
#initTheme() {
const colorSchemeChangeObserver = matchMedia("(prefers-color-scheme: dark)")
colorSchemeChangeObserver.addEventListener("change", () => this.#updateColorScheme());
-
this.#updateColorScheme();
+
+ document.body.setAttribute("data-theme-id", options.get("theme"));
}
#updateColorScheme() {