GNOME Bugzilla – Bug 779127
Add CSS selectors :nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type
Last modified: 2018-05-02 18:09:29 UTC
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: * https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-of-type * https://www.w3schools.com/cssref/sel_nth-of-type.asp
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/766.