Description
Here's an example of what I've found when styling in Polymer, although I assume the problem is with shady polyfill itself
I have a container element with a slot and default style for all slotted elements. It's important that I select the slotted element by id
<dom-module id="my-container">
<template>
<style>
section#sn :slotted(*) {
color: red;
}
</style>
<section id="sn" class="sn">
<slot></slot>
</section>
</template>
</dom-module>
In another element I distribute a node and apply same rule in Light DOM
<dom-module>
<template>
<style>
p {
color: green;
}
</style>
<my-container>
<p>Green text</p>
</my-container>
</template>
</dom-module>
Expected behaviour
The paragraph should be green
Actual behaviour
In browsers using polyfill it will be red.
Attached is the above example
Workaround
When selecting the slotted element one has to be very careful not be too specific. Above even if changed to using class section.slot ::slotted(*)
alone won't help without making the selector in my-app
more specific like.
my-container p {
color: green;
}
Otherwise the naked p
selector will still be too little specific.