I’ve created a gist regarding an @useShadowDOM issue:
What did I wrong? There’s the following error in console:
DOMException: Failed to execute ‘attachShadow’ on ‘Element’: This element does not support attachShadow
Is scoped css (@useShadowDOM / as=“scoped”) supported in IE 11?
So this means I cannot use scoped css at all if I have to support IE 11? My problem is that if I use as=“scoped” and @useShadowDOM, the styles are not applied in IE 11, even not in the element itself.
You cannot just enable ShadowDOM on
ShadowDOM has this unintuitive requirement: the tag name must contain at least one dash, you need to name your custom element like
Change message to my-message, your gist works.
Yes I know thank you, I already fixed my gist:
But, in IE11 the styles are not working, even not in the element (my-message) itself. It’s hard to proove as viewing gists is not supported in IE11
Is it possible to use scoped css for the modern browsers and have a kind of fallback to global styles for IE 11?
The village naive code here.
Could you not detect browser type/version on load, and just globally load the css there if its an older one, and let it fall through to the scoped in the view if supported?
Not sure if it would double load, or just ignore the scoped, but if it does ignore it then it might work.
I guess the issues is bundling the css all together and running into naming conflicts.