Try to use existing updateStyles for theming (#1217)

This commit is contained in:
Andrey 2018-05-27 18:56:01 +03:00 committed by Paulus Schoutsen
parent d3b6740488
commit dd57ddbef6

View File

@ -23,8 +23,10 @@ export default function applyThemesOnElement(element, themes, localTheme, update
styles[prefixedKey] = theme[key];
});
}
// implement updateStyles() method of Polemer elements
if (window.ShadyCSS) {
if (element.updateStyles) {
element.updateStyles(styles);
} else if (window.ShadyCSS) {
// implement updateStyles() method of Polemer elements
window.ShadyCSS.styleSubtree(/** @type {!HTMLElement} */(element), styles);
}