Re: [csswg-drafts] [selectors] pseudo selector to match forms ValidityState (#1525)

The CSS Working Group just discussed `[selectors] pseudo selector to match forms ValidityState`, and agreed to the following:

* `RESOLVED: use proposed functional syntax for invalid and user-invalid`
* `ACTION: open issue on specificity for functional invalid and user-invalid`

<details><summary>The full IRC log of that discussion</summary>
&lt;JoshT> lwarlow: idea behind this is CSS doesn't provide everything you want to style stuff like error boxes based on validity of form controls<br>
&lt;JoshT> ... exists some existing selectors for in-range and out-of-range<br>
&lt;JoshT> ... but that is limited view<br>
&lt;JoshT> ... in HTML, there are various attributes for constraints<br>
&lt;JoshT> ... idea is to bring those to CSS<br>
&lt;JoshT> ... discussed whether to add lots of pseudo classes<br>
&lt;Rossen> q?<br>
&lt;JoshT> ... could make invalid and user-invalid functional, take a keyword that maps to validity state<br>
&lt;Rossen> ack kbabbitt<br>
&lt;kbabbitt> q-<br>
&lt;TabAtkins> seems reasonable to me<br>
&lt;fantasai> same<br>
&lt;TabAtkins> (the functional form)<br>
&lt;TabAtkins> belongs in Selectors<br>
&lt;JoshT> lwarlow: if we spec this, would it go in selectors or css-forms for now?<br>
&lt;fantasai> +1 to functional form<br>
&lt;JoshT> Rossen: let's resolve first. people seem convinced<br>
&lt;emilio> q+<br>
&lt;davidjmarland> functional gets my vote. reduces confusion that `div:too-long` might do something<br>
&lt;Rossen> ack emilio<br>
&lt;JoshT> emilio: how does this interact with horistics? normally set when user changes control<br>
&lt;JoshT> ... does the interaction resolve on failure in some way?<br>
&lt;JoshT> fantasai: right now, heuristics on when to do matching. but this would narrow it down to show you if it's invalid in a particular way<br>
&lt;lwarlow> q+<br>
&lt;JoshT> emilio: should a functional user-invalid be invalid in a particular way or an action results in the error?<br>
&lt;JoshT> fantasai: equiv to user-invalid + invalid in a particular way<br>
&lt;JoshT> emilio: could we instead expand :invalid?<br>
&lt;JoshT> lwarlow: i don't think we need both. we could expand one<br>
&lt;Rossen> ack lwarlow<br>
&lt;JoshT> ... but for ease of developers, making it work on both seems easy to implement<br>
&lt;JoshT> fantasai: requiring just for a specific thing is not great, plus messes with specificity if you add one more pseudo<br>
&lt;JoshT> emilio: i'm OK with it. but would it be useful to have an extra ???<br>
&lt;JoshT> ... and do we want the functional version to be more specific than non-functional<br>
&lt;JoshT> fantasai: pseudo-classes have the same specificity of a class<br>
&lt;fantasai> s/have/typically have/<br>
&lt;lwarlow> q+<br>
&lt;bramus> +1 to more specific<br>
&lt;JoshT> emilio: there are exceptions. I'm OK with that. but it feels like it might want to be more specific<br>
&lt;Rossen> ack lwarlow<br>
&lt;JoshT> lwarlow: it being more specific might be useful<br>
&lt;castastrophe> +1 to consistency, not more specific<br>
&lt;JoshT> ... you might have an overall style that's invalid, and you want to override with a more specific type of invalidity<br>
&lt;romain> +1 to not more specific<br>
&lt;JoshT> ... but I'm fine either way<br>
&lt;romain> adding specificity is easier than removing it<br>
&lt;castastrophe> I feel like irc needs like a polling gui 🤣<br>
&lt;JoshT> ... we could answer that with prototyping<br>
&lt;fantasai> POLL: Should the argument add specificity?<br>
&lt;fantasai> (yes/no)<br>
&lt;lwarlow> Yes<br>
&lt;romain> no<br>
&lt;bramus> yes<br>
&lt;TabAtkins> no<br>
&lt;castastrophe> no<br>
&lt;JoshT> no<br>
&lt;davidjmarland> no<br>
&lt;dshin-moz> yes<br>
&lt;lea> no<br>
&lt;ChrisL> abstain<br>
&lt;astearns> abstain<br>
&lt;miriam> yes<br>
&lt;hoch> abstain<br>
&lt;kbabbitt> no<br>
&lt;lea> q?<br>
&lt;JoshT> Rossen: poll favours no<br>
&lt;JoshT> fantasai: this is not just a bikeshedding issue so I don't think we can call it based on this<br>
&lt;JoshT> ... I think the question needs more consideration<br>
&lt;lwarlow> Follow-up sounds good to me<br>
&lt;castastrophe> +1 fantasai, seems like a needs more data result<br>
&lt;JoshT> Rossen: That's also where I was going. We can open a follow up issue in the specificity<br>
&lt;JoshT> PROPOSAL: use proposed functional syntax for invalid and user-invalid<br>
&lt;lwarlow> +1<br>
&lt;JoshT> RESOLVED: use proposed functional syntax for invalid and user-invalid<br>
&lt;lea> Re:specificity, to elaborate on my "no", conceptually I agree it should add specificity, but currently, specificity is a pretty blunt instrument. How would it add specificity? By adding to the type selector count? That would be quite unprecedented<br>
&lt;JoshT> Rossen: does this go into selectors, where it is currently?<br>
&lt;JoshT> ... or does it go to css-forms, or anywhere else?<br>
&lt;dbaron> I think I also lean no on specificity<br>
&lt;TabAtkins> Prefer Selectors<br>
&lt;TabAtkins> Agree, Lea. And while "being more specific *somehow*" does make some sense, in practice I think it's just fine to rely on ordering for this - generic styling will go first, specific styles will go after.<br>
&lt;JoshT> ... we will leave in selectors for now<br>
&lt;TabAtkins> I don't want to get into "one iota more specific"<br>
&lt;JoshT> ACTION: open issue on specificity for functional invalid and user-invalid<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1525#issuecomment-4083878134 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 18 March 2026 16:27:47 UTC