Closed jwmcglynn closed 3 months ago
Here's a good list of pseudo class selectors to initially support, from librsvg: https://gnome.pages.gitlab.gnome.org/librsvg/devel-docs/features.html#pseudo-classes
Pseudo-class selectors from https://www.w3.org/TR/selectors-4/
Initial pseudo-class selectors are in 4a51f7d9f79f7b33f8cb2f68ab35981a0844e32e
a2fac7fcc727398dc7f8b07d8dc6890c1f6ff08c adds support for these ones
:first-of-type
:last-of-type
:only-of-type
:nth-of-type(...)
:nth-last-of-type(...)
Currently :nth-of-type(... [of S]?)
only accepts a TypeSelector, it needs to be updated to parse a forgiving-selector-list. Added to the description.
Per the CSS spec:
The :nth-child(An+B [of S]? ) pseudo-class notation represents elements that are among An+Bth elements from the list composed of their inclusive siblings that match the selector list S, which is a
parsed as a forgiving selector list. If S is omitted, it defaults to |.
Initial support for :is()
, :where()
, :not()
added in https://github.com/jwmcglynn/donner/commit/56b9b64982c661723c9dd6655614a53f65e927d9
:nth-of-type(... of S)
now accepts a <forgiving-selector-list>
, as defined by the latest Selectors 4 spec: https://www.w3.org/TR/2022/WD-selectors-4-20221111/#forgiving-selectorRemaining work before closing out this task are :has()
and :defined
, and maybe :scope
.
For :has()
, support needs to be added for parsing a <forgiving-relative-selector-list>
.
There's a long tail of other pseudo-classes, but most are only relevant once other features such as interactivity, animation, or localization are added.
:scope
support added in 99ba003a669b9e62746b31235529cfd58abdf583
https://github.com/jwmcglynn/donner/commit/5a8bace904bf19e5c36043dbcff0ea9630c3abc7 adds support for :has()
TypeSelector
:nth-last-child
the[of S]?
syntax should accept an forgiving selector list