Re: [w3c/webcomponents] "::slotted" pseudo elements (#331)

Right, that's because :host() always represents the host element; it just uses the argument to query the tree to see if it should match or not.  Putting ::before inside the argument wouldn't make any sense - you dont' want to check if an ancestor has a ::before pseudo-element.

::slotted, on the other hand, uses its argument to decide *which* of its assigned slotables it's supposed to represent.  As such, it makes a *little* more sense to have ::before inside.

(At least, it makes as much sense as using doing something like `:matches(.foo, .foo::before)`, which is allowed.)

I don't have a problem with `::slotted(.foo)::before`, it just means dealing with chained pseudo-elements.  Which we had before, so it's probably not a problem.

---

I'll also note that if you're drawing parallels between `:host()` and `::slotted()`, authors probably will too - they select up and down outside the shadow tree.  Having them work as similarly as possible (main difference being the number of colons) is probably good for comprehension.  So that's an argument for `::slotted()::before`.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/331#issuecomment-210172321

Received on Thursday, 14 April 2016 22:00:21 UTC