Re: [w3c/webcomponents] Support Custom Pseudo-elements (#300)

The main intent for shadow-pseudos (or "part selectors" as I like to call them) is actually to represent parts of a compound custom element, not states. This makes them more like pseudo-elements than pseudo-classes. In fact, the analogues for styling of UA built-in controls are pseudo-elements.

To meet the use case of styling specific parts of custom elements (like only the text field of a combo box, or only the button, or only the menu), it needs to be possible for more than one part to match the same part selector. The reason is that sometimes a control has more than one of logically the same part repeated. Sometimes the number of repeats of the part may be variable. For example, an image carousel custom element may want to let you style the images (to add a border, a filter effect, etc). It would be much simpler to have a single "content-image" pseudo, than to have a separate indexed one for each image.

I'm not sure if the opposite is necessary - one element in the shadow DOM corresponding to more than one part. Offhand I can't think of a use case that requires this.

-- 
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/300#issuecomment-273318665

Received on Tuesday, 17 January 2017 22:19:28 UTC