- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Mon, 12 Feb 2024 18:16:43 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `[css-view-transitions-2] Specificity of view transition pseudos with classes`, and agreed to the following: * `RESOLVED: for view transition pseudos, have * argument as 0 specificity, and everything else 1 type like specificity` <details><summary>The full IRC log of that discussion</summary> <TabAtkins> vmpstr: We have VT pseudos that take a paramter<br> <TabAtkins> vmpstr: take name, *, and now classes<br> <TabAtkins> vmpstr: makes the arg syntax more involved<br> <TabAtkins> vmpstr: before classes, specificifity of the pseudo was 0 if *, and 1 tag-like specificity if it took a name<br> <TabAtkins> vmpstr: with classes, should probably change a bit. a few options<br> <TabAtkins> vmpstr: First option, and front-runner, is have every non-asterisk token count as a tag for specificity. just add them up<br> <TabAtkins> vmpstr: minor problem here is having a name and a class has the same specificity. only downside.<br> <TabAtkins> vmpstr: Second option is have the name be ID-like and class be class-like<br> <TabAtkins> vmpstr: This is also simple, and similar to :has()/:is()<br> <TabAtkins> vmpstr: counter-argument is :has/is are more structural, this is specifically a VT element<br> <TabAtkins> vmpstr: Last option is to use the argument just as a tiebreaker<br> <bramus> q+<br> <khush> q+<br> <TabAtkins> vmpstr: so you use the argument solely if selectors entirely tie.<br> <TabAtkins> vmpstr: a bit more complicated to spec and implement<br> <TabAtkins> vmpstr: I initially thought the tiebreaker is best, but I'm convinced now it's more complex than necessary. I think option 1 is good enough, where every token is just a tag-like for spec.<br> <miriam> ack bramus<br> <TabAtkins> bramus: I'm on board with Vlad - option 3 was my first, but option 1 is easy to comprehend.<br> <TabAtkins> bramus: I dont' think option 2 is viable since you're changing existing beahvior<br> <TabAtkins> bramus: often authors today are adding a clause to the root to flip the animation direction<br> <TabAtkins> bramus: that adds a class-like specificity to make it win<br> <TabAtkins> bramus: If we change to have the name be ID-like, it could override those. so it's a breaking change<br> <miriam> ack khush<br> <TabAtkins> khush: echoing Vlad, if we made an ideal choice we'd add a new specificity term<br> <fremy> q?<br> <fremy> q+<br> <TabAtkins> khush: the pseudo arguments are just what specific pseudo you're selecting, my intuition it's less important than what element is being targeted for the pseudo<br> <TabAtkins> khush: but it is indeed a lot more complex, and so just doing Option 1 is fine<br> <TabAtkins> khush: I'm the one that suggested giving the name ID-like spec, but we have already specced different beahvior indeed<br> <TabAtkins> khush: one nice thing is the another feature for VT types lets you not rely on outside elements to select. hopefully that can reduce the issue with specificity - you'll generally just use the VT type only<br> <khush> q?<br> <miriam> ack fremy<br> <TabAtkins> fremy: Is this even required?<br> <TabAtkins> fremy: current behavior is just [0,0,0] or [0,0,1]<br> <TabAtkins> fremy: If you do that you can just order them in your stylesheet as needed<br> <TabAtkins> fremy: Is there really a use-case for having them implicitly ordered somehow? Just wondering if it's even worth increasing the specificity<br> <TabAtkins> vmpstr: good question. if you order them correctly in your stylesheet - we still have to say what happens if you specify a class but not a name<br> <noamr> q+<br> <TabAtkins> vmpstr: But adding them to get a larger count is optional, sure. If just feels more specific if you add more class names, or class+name, then just adding a name by itself<br> <TabAtkins> vmpstr: So just adding them up is probably Good Enough and somewhat intuitive<br> <TabAtkins> fremy: Yeah, just something new to learn. if it's not required, might be okay to just do nothing new<br> <TabAtkins> vmpstr: So your proposal is just "anything but asterisk is [0,0,1]"<br> <TabAtkins> noamr: And that doesn't compete with HTML in the selector<br> <miriam> ack noamr<br> <TabAtkins> vmpstr: And then your tiebreaker would be declaration order<br> <TabAtkins> bramus: i'm not sure if having asterisk 0 and anything else be 1...<br> <TabAtkins> bramus: i can imagine a scenario "all .card animate one way, but one specific card animate another"<br> <khush> q+<br> <miriam> ack khush<br> <TabAtkins> vmpstr: if that specific one is targeted with a name, wouldn't fix things - still would be [0,0,1]<br> <TabAtkins> khush: yeah intuitively you might write ::vt(special-card) and ::vt(.card), expecting first to win, but that's a harder model to specify<br> <TabAtkins> khush: So maybe better here indeed to just rely on name ordering<br> <vmpstr> proposal: for view transition pseudos, have * argument as 0 specificity, and everything else 1 type like specificity<br> <TabAtkins> miriam: objections?<br> <TabAtkins> RESOLVED: for view transition pseudos, have * argument as 0 specificity, and everything else 1 type like specificity<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9887#issuecomment-1939286361 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 12 February 2024 18:16:46 UTC