diff --git a/src/ShadowCSS.js b/src/ShadowCSS.js index e38aebf..75e6b78 100644 --- a/src/ShadowCSS.js +++ b/src/ShadowCSS.js @@ -153,16 +153,20 @@ var ShadowCSS = { this.applyScopeToContent(root, name); } this.shimPolyfillDirectives(def.rootStyles, name); - this.applyShimming(def.scopeStyles, name); + var cssText = this.stylesToShimmedCssText(def.scopeStyles, name); + // note: it's critical that polyfill-rules are not shimmed. + cssText += '\n\n' + this.extractPolyfillRules(def.scopeStyles, name); + // provide shimmedStyle for user extensibility + root.shimmedStyle = def.shimmedStyle = cssTextToStyle(cssText); + // remove existing style elements + for (var i=0, l=def.rootStyles.length, s; (i