tailwindcss/tests
Ifeanyi Madu ff8b2a0db9
Fix extraction of quoted arbitrary variants in v3 (#20374)
## 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

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2026-08-03 15:57:26 +02:00
..
fixtures remove unused fixture files 2021-12-15 18:13:09 +01:00
plugins Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
postcss-plugins/nesting Improve CSS output in tests to better reflect reality (#10454) 2023-01-31 15:37:49 +01:00
util Loosen :is() wrapping rules in applyImportantSelector for more readable output. (#13900) 2024-07-16 10:51:45 -04:00
animations.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
any-type.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
apply.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
arbitrary-properties.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
arbitrary-values.test.css Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
arbitrary-values.test.html Ensure repeating-conic-gradient is detected as an image (#11180) 2023-07-13 11:48:35 -04:00
arbitrary-values.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
arbitrary-variants.test.js v3: Allow hyphen character in regex pattern to use support queries as is (#13605) 2025-01-28 17:42:09 +01:00
basic-usage.test.css Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
basic-usage.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
blocklist.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
collapse-adjacent-rules.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
collapse-duplicate-declarations.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
color-opacity-modifiers.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
color.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
combined-selectors.test.js Insert @defaults at start of stylesheet (#14427) 2024-09-17 09:09:08 -04:00
configurePlugins.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
containerPlugin.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
context-reuse.test.html inline tests (#10362) 2023-01-19 11:42:52 +01:00
context-reuse.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
custom-extractors.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
custom-plugins.test.js v3: Remove irrelevant utility rules when matching important classes (#19030) 2025-09-29 18:11:09 -04:00
custom-separator.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
custom-transformers.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
customConfig.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
dark-mode.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
default-extractor.test.js Fix extraction of quoted arbitrary variants in v3 (#20374) 2026-08-03 15:57:26 +02:00
defaultConfig.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
defaultTheme.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
escapeClassName.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
evaluateTailwindFunctions.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
experimental.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
extractor-edge-cases.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
flattenColorPalette.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
format-variant-selector.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
generate-rules.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
getClassList.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
getSortOrder.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
getVariants.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
import-syntax.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
important-boolean.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
important-modifier-prefix.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
important-modifier.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
important-selector.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
kitchen-sink.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
layer-at-rules.test.js Insert @defaults at start of stylesheet (#14427) 2024-09-17 09:09:08 -04:00
layer-without-tailwind.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
match-components.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
match-utilities.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
match-variants.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
min-max-screen-variants.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
minimum-impact-selector.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
modify-selectors.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
mutable.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
negated-content-ignore.test.html Fix using negated content globs (#5625) 2021-09-29 11:15:31 +01:00
negated-content-include.test.html Fix using negated content globs (#5625) 2021-09-29 11:15:31 +01:00
negated-content.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
negateValue.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
negative-prefix.test.js [v3] Support negative values for {col,row}-{start,end} utilities (#13781) 2024-06-03 11:34:27 -04:00
normalize-config.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
normalize-data-types.test.js v3: Don’t break sibling-*() functions when used inside calc(…) (#19335) 2025-11-19 10:35:48 -05:00
normalize-screens.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
opacity.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
parallel-variants.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
parseAnimationValue.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
parseObjectStyles.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
prefers-contrast.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
prefix.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
prefixSelector.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
preflight.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
raw-content.test.css Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
raw-content.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
relative-purge-paths.test.html inline tests (#10362) 2023-01-19 11:42:52 +01:00
relative-purge-paths.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
resolve-defaults-at-rules.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
resolveConfig.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
responsive-and-variants-atrules.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
safelist.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
screenAtRule.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
shared-state.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
source-maps.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
syntax-lit-html.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
syntax-svelte.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
syntax-svelte.test.svelte Rename svelte tests 2021-09-21 12:37:49 -04:00
tailwind-screens.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
to-path.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
variants.test.css Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
variants.test.html Move forced-colors variant after dark variant (#12582) 2023-12-18 13:58:22 -05:00
variants.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00
warnings.test.js Cleanup oxide — Part #2 (#13312) 2024-03-22 17:12:14 +01:00
withAlphaVariable.test.js Add variable fallback to fix Chrome issue (#15003) 2024-11-14 13:33:27 -05:00