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

If you think of pseudo-elements and pseudo-classes as analogies for elements and classes, it's the case that an element has only one tag name and multiple class names. So perhaps it is right that any given element should only have up to one part name, and optionally multiple state names.

Going back to the calendar example, you'd probably have to do it as `<day class="weekday Saturday week-1 us-holiday>`. It is perhaps over-engineering to let pseudo-elements have multiple pseudo-element "tag names", since markup itself doesn't have that. While it would be neat, it seems like the world where there's only one tag name has generally be livable. And built-in UA pseudo-classes for form controls don't use multi part naming either.

Taking that direction, there'd be no need for `::part(day us-holiday)`, instead we just need to make sure `::--day:--us-holiday` works.



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

Received on Friday, 8 May 2020 18:49:07 UTC