Add CSS selectors :nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type
@dboles
Submitted by Daniel Boles Link to original bug (#779127)
Description
In CSS,
[other-selectors] node-name:nth-of-type(N)
selects the first child of that name, in the context of the preceding selectors. It's like :nth-child(N), but it only counts across nodes with the matching name.
:nth-last-of-type does the same, but from the other end of the list of children.
:first- and :last-of-type are just convenient aliases for the :nth selectors.
These could be really useful to have in GTK+. At the least, having these would obviate the need to add classes/IDs to widgets that need special styling for their place in a container.
AFAICT, these selectors are still in Working Draft status in CSS Selectors Level 4. However, they are widely implemented in browsers - even IE v9 supported them, according to these: