[selectors] :first-node
/:last-node
/:only-node
pseudo-classes
#11154
Labels
:first-node
/:last-node
/:only-node
pseudo-classes
#11154
Currently,
:*-child
pseudo-classes only consider element children, and will match even if the element has text nodes before it. For example, in<button>foo <i>A</i> bar</button>
:first-child
,:last-child
and:only-child
will all match. For many use cases, it is important to match when the node is actually the first/last/only one.I have not found use cases requiring
:nth-node()
, so I think the three titular pseudos should do it.The text was updated successfully, but these errors were encountered: