Skip to content

[selectors-5] Add custom state pseudo-classes #8213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 13, 2024
11 changes: 11 additions & 0 deletions selectors-4/deferred-for-level-5
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,14 @@ The local link pseudo-class '':local-link''</h3>
What about if the document url has less than N segments,
and the link is same-page?
Should "null segments" count as matching, or not?

<h3 id="custom-pseudo">Exposing custom state: the '':state()'' pseudo-class</h3>

The <dfn selector>:state()</dfn> pseudo-class takes an argument and matches
custom elements whose exposed custom states include the argument.

The grammar of the '':state()'' pseudo-class is:

<pre class=prod>:state( <<string>> )</pre>

TODO add some text explaining that this is defined in the HTML spec? The :user-valid pseudo class is like this too: https://github.com/w3c/csswg-drafts/pull/9308