Skip to content

Fix extraction of quoted arbitrary variants in v3 - #20374

Merged
RobinMalfait merged 4 commits into
tailwindlabs:v3from
supermadu7:fix/v3-extractor-variant-order
Aug 3, 2026
Merged

Fix extraction of quoted arbitrary variants in v3#20374
RobinMalfait merged 4 commits into
tailwindlabs:v3from
supermadu7:fix/v3-extractor-variant-order

Conversation

@supermadu7

@supermadu7 supermadu7 commented Jul 31, 2026

Copy link
Copy Markdown

Summary

Fixes #18387.

The v3 default extractor did not capture the complete candidate when a standard variant preceded an arbitrary selector containing quoted values, such as focus-visible:[&:not([aria-selected="true"])]:bg-red-500.

The quote-aware pattern allowed quote characters in the standard-variant portion, causing extraction to begin at the surrounding class or className attribute and split the candidate. This change excludes single and double quotes from that portion of the pattern while continuing to allow quotes inside arbitrary variants.

Regression tests cover both single- and double-quoted selectors with preceding focus-visible and hover variants.

[ci-all]

Test plan

  • npx jest tests/default-extractor.test.js tests/arbitrary-variants.test.js --runInBand
  • npm test -- --runInBand

Results:

  • 86 test suites passed
  • 1,060 tests passed
  • 1 test marked todo
  • 4 snapshots passed

@supermadu7
supermadu7 requested a review from a team as a code owner July 31, 2026 17:18
@supermadu7
supermadu7 changed the base branch from main to v3 July 31, 2026 17:46
@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (3): Last reviewed commit: "update comment" | Re-trigger Greptile

@RobinMalfait
RobinMalfait force-pushed the fix/v3-extractor-variant-order branch from a91f489 to 53e8210 Compare August 3, 2026 13:55
@RobinMalfait
RobinMalfait enabled auto-merge (squash) August 3, 2026 13:57

@RobinMalfait RobinMalfait left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@RobinMalfait
RobinMalfait merged commit ff8b2a0 into tailwindlabs:v3 Aug 3, 2026
29 checks passed
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.

Modifier order issue: variants before arbitrary not selectors fail to apply styles

2 participants