Skip to content

Conversation

@ix
Copy link

@ix ix commented Jun 21, 2025

This PR adds the following CSS level 3 structural pseudo-classes to yesod-test:

  • :first-child
  • :last-child
  • :nth-child (with an implementation of the 'an + b' syntax)

... I've decided to implement the remaining set of pseudo-classes, so have marked this as a draft in the meantime

Reference material

These pseudo-classes facilitate easier matching of sequential elements and are particularly useful when inspecting lists or tables.


Before submitting your PR, check that you've:

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

@ix ix force-pushed the new-selectors branch 2 times, most recently from 9a1f31c to 3f86632 Compare June 21, 2025 22:53
@ix ix force-pushed the new-selectors branch from 3f86632 to 7d9fc11 Compare June 21, 2025 22:56
@ix ix marked this pull request as draft June 23, 2025 01:09
@jezen
Copy link
Member

jezen commented Jun 23, 2025

This looks very cool!

@ix
Copy link
Author

ix commented Jun 23, 2025

Thanks! I'm aiming to implement the remainder of the Level 3 structural pseudo-classes within the next few days and I'll also add more test cases in main.hs against the Firefox implementation (using the following function).

function runQuery (s, e) {
  return new DOMParser().parseFromString(s, "text/html").querySelectorAll(e);
}

Once that's done I'll unmark this as draft 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants