tailwindcss/tests
Jordan Pittman aecc8521dc
v3: Remove irrelevant utility rules when matching important classes (#19030)
Fixes #18678

When given a simple plugin like this:
```js
export default {
  content: [{ raw: '!a' },],
  plugins: [
    ({ addBase }) => addBase({
      '@media (min-width: 1728px)': {
        '.a': { 'padding-top': '1rem !important' },
        '.b': { 'padding-right': '1rem !important' },
      }
    }),
  ],
}
```

If this plugin saw the utility `!a` it would correctly modify both rules
to eliminate any irrelevant classes. Unfortunately, in the case of the
2nd rule this meant it's left with an empty selector which is invalid.

We now detect this case and remove the rule if that happens.
2025-09-29 18:11:09 -04: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 class detection in Slim templates with attached attributes and IDs (#14019) 2024-07-18 11:21:20 -04: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 Allow anchor-size(…) in arbitrary values (#14393) 2024-09-11 19:23:53 +02: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