Re: [csswg-drafts] [css-shadow-parts] What's the purpose of multiple idents in ::part()? (#4412)

This was discussed pretty heavily at TPAC. ^_^

Yes, the "tab active" example is better as a part/state combo, now that we're doing states. That's just an obvious first example I came up with, tho. 

There are a million reasons why something would have two classes, neither of which are really "states", that you'd want to select on the intersection of.  An example that came up during TPAC is styling a calendar widget - each of the days is exposed with a part=day, and then individual days can have part=monday, part=weekend, part=holiday, etc. If you're styling holidays different from normal days, and weekends and weekdays a little differently from each other, then you probably want to style *holiday* weekends and weekdays a little differently too.

And to head an obvious interjection off at the pass: yes, you could encode these as states. Or you could encode all of them as part names. The semantic distinction between the categories is very fuzzy, but as long as have both, the obvious distinction is that parts are permanent and part of the identity of the element, while states are transitory and might change. Under this distinction, all of the names in my calendar example are definitely part names, not states.

So yeah, I agree that the spec examples and explanation need to be updated now that :state() exists.

GitHub Notification of comment by tabatkins
Please view or discuss this issue at using your GitHub account

Received on Friday, 11 October 2019 15:50:26 UTC