Adding theme class name flag into #app

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2020-08-21 09:25:31 +03:00
1 parent 19e9cc3799
commit 11375f737e
1 file changed
+3
+3
View File
@@ -93,6 +93,9 @@ export class ThemeStore {
return `--${cssName}: ${color} !important;`
});
this.styles.textContent = `:root {\n${cssVars.join("\n")}}`;
// Adding universal theme flag which can be used in component styles
const rootElem = document.getElementById("app");
rootElem.classList.toggle("theme-light", theme.type === ThemeType.LIGHT);
}
}