Skip to content

feat: support nth of, fix :enabled#1754

Merged
fb55 merged 4 commits intomasterfrom
nth-of
Mar 22, 2026
Merged

feat: support nth of, fix :enabled#1754
fb55 merged 4 commits intomasterfrom
nth-of

Conversation

@fb55
Copy link
Copy Markdown
Owner

@fb55 fb55 commented Mar 22, 2026

  • Support of in nth pseudo classes, e.g. :nth-last-child(1 of .a)
  • Enabled should only apply to form elements

Copilot AI review requested due to automatic review settings March 22, 2026 21:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Selectors Level 4 support for :nth-child(An+B of S) / :nth-last-child(An+B of S) and adjusts :enabled to only match relevant form controls.

Changes:

  • Extend nth-family pseudo filter compilation to handle the optional of <selector-list> clause.
  • Update :enabled alias to restrict matching to form-related elements and exclude :disabled.
  • Add tests covering :enabled and :nth-child(... of ...) / :nth-last-child(... of ...).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
test/pseudo-classes.ts Adds test coverage for :enabled and :nth-*(... of ...) behavior.
src/pseudo-selectors/index.ts Passes compileToken through to filter compilers to enable nested selector compilation.
src/pseudo-selectors/filters.ts Implements of-clause handling for nth-child / nth-last-child and refactors nth logic.
src/pseudo-selectors/aliases.ts Fixes :enabled alias to only target form-control-like elements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fb55 fb55 changed the title feat: support nth of feat: support nth of, fix :enabled Mar 22, 2026
@fb55 fb55 enabled auto-merge (squash) March 22, 2026 22:36
@fb55 fb55 merged commit d3fc608 into master Mar 22, 2026
12 checks passed
@fb55 fb55 deleted the nth-of branch March 22, 2026 22:36
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