Re: [csswg-drafts] [css-shadow-parts] Unifying ::part() and ::--foo (#4900)

> Note that that's the motivation behind my proposal in the OP; preserve the more useful behavior of class-like names, but also preserve the looks-like-builtin nature of pseudo-element names.

But by using `::part` you're shunting all shadow parts into being a certain type of pseudo-element, rather than allowing custom elements to create their own type of custom pseudo-elements.

Again, I agree that class-like behavior on shadow parts is very useful, but we can expose that as classes of pseudo-elements rather than inventing something new and different.

Another thing that occurred to me, I think it was Amelia who suggested that since custom state now uses a '--' prefix, we can potentially allow the API to set a safe-listed set of built-in pseudo-class names in the future, e.g. 'active', 'checked', etc. The same applies to custom pseudo-elements, by putting all the custom pseudo-elements behind a '--' prefix, in principle we can allow certain built-in pseudo-elements as well, e.g. allow a custom element to have a 'placeholder' or 'marker' shodow part that can be selected via `::placeholder` or `::marker`. 

-- 
GitHub Notification of comment by plinss
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4900#issuecomment-625954083 using your GitHub account

Received on Friday, 8 May 2020 18:29:38 UTC