Closed btopro closed 4 years ago
can you elaborate on this. These selectors definitely work when i remove and re-insert to test. You're right they don't work on 1st level elements.
::slotted
has to have something before it. So let's say your structure is
<div>
<slot></slot>
</div>
Then you could do a css selector of div ::slotted(img)
which will apply only to images at the 1st level that show up in the slotted area. Still though, ::slotted needed that div
selector before it to do anything
Because slotted is a bit weird; this won't work unless it looks like
:host * ::slotted(img)
. Slotted is a bit of a hack in the spec to be honest and I'm surprised they ever accepted it since it doesn't work for anything below the 1st level childrenhttps://github.com/dtn9197/herocard/blob/6672dc674a57a37de3c8076e355fe3ed443f2540/src/HeroCard.js#L46