feat(css): add attribute scoped css without global refresh (#7907)

This commit is contained in:
joshcomley
2019-10-08 13:35:39 +01:00
committed by Martin Yankov
parent 5c9a217bc5
commit f791a403cd
3 changed files with 14 additions and 9 deletions

View File

@@ -195,11 +195,13 @@ export function run(entry?: NavigationEntry | string) {
_start(entry);
}
export function addCss(cssText: string): void {
export function addCss(cssText: string, attributeScoped?: boolean): void {
notify(<CssChangedEventData>{ eventName: "cssChanged", object: androidApp, cssText: cssText });
const rootView = getRootView();
if (rootView) {
rootView._onCssStateChange();
if (!attributeScoped) {
const rootView = getRootView();
if (rootView) {
rootView._onCssStateChange();
}
}
}