diff --git a/src/common/dom/apply_themes_on_element.js b/src/common/dom/apply_themes_on_element.js index 267b9bafd8..a21ac4ed82 100644 --- a/src/common/dom/apply_themes_on_element.js +++ b/src/common/dom/apply_themes_on_element.js @@ -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); }