Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gtk gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,438
    • Issues 1,438
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 244
    • Merge requests 244
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • gtkgtk
  • Issues
  • #766

Closed
Open
Created Feb 23, 2017 by Bugzilla@bugzilla-migration💬Reporter

Add CSS selectors :nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type

Submitted by Daniel Boles @dboles

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:

  • https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-of-type
  • https://www.w3schools.com/cssref/sel_nth-of-type.asp
Assignee
Assign to
Time tracking