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

I'm just a user, but, in my opinion, there is a need for pseudo-element functionality from a perspective of allowing a component author to provide a stable public interface for styling a component.  As a component author, I should be able to change the internal implementation details of my web component without any disruption to a component user.  The only way I can feasibly do that is to have an explicit mechanism for defining my publicly style-able surface.  Custom pseudo elements do this.  While `@apply` appears to actually do so as well, custom pseudo elements have benefits beyond lack of difficulty with pseudo classes.

Vendor elements that utilize obscured internals have long allowed styling of certain portions via pseudo elements. And, correct me if I'm wrong, isn't there some work on standardizing these for common replaced elements, like form controls?  Therefore, with custom pseudo elements, a user authored component would be style-able like a vendor component.  Having user authored elements feel like native elements is a good thing--and not _only_ because having the standard explain the existing platform is nice.

A component user does not have to learn any new language constructs to style a custom pseudo element, and yet can still enhance their use of a custom pseudo element with new CSS features as they develop.  While I am enthusiastic about bringing popular pre-processor features (and implied enhancements, like `@apply`) to CSS, I am also of the opinion that, in respect to web component styles, we should lean toward allowing CSS authors to simply...write familiar CSS.  Since several of the CSS standards are _brand_ spanking new, surely they would have kinks needing to be worked out?  As a result, it seems to me that it would be putting the cart before the horse to hang the style story for Shadow DOM on them.


---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/300#issuecomment-143857208

Received on Monday, 28 September 2015 19:53:49 UTC