webcomponents / webcomponents/polyfills
[ShadyCSS] Cannot load the polyfill async
- Dominant language
- HTML
- Stars
- 1.2k
- Forks
- 168
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to load the polyfills conditionally, async and am not able to shim styles.
http://jsbin.com/qaxifecapa/edit?html,output works in Canary, but not in other browsers.
If you uncomment the `` tags in that jsbin that load the polyfills and replace this:
``` javascript
lazyLoadWCPolyfillsIfNecessary().then(function(events) {
if (!supportsShadowDOMV1) {
ShadyCSS.prepareTemplate(CardSwiper.template, CardSwiper.is);
}
window.customElements.define(CardSwiper.is, CardSwiper);
});
```
with:
``` javascript
ShadyCSS.prepareTemplate(CardSwiper.template, CardSwiper.is);
window.customElements.define(CardSwiper.is, CardSwiper);
```
then the demo works as expected.
Contributor guide
Assessment
This issue has not been assessed yet.