diff --git a/packages/@tailwindcss-upgrade/src/template/codemods/modernize-arbitrary-values.test.ts b/packages/@tailwindcss-upgrade/src/template/codemods/modernize-arbitrary-values.test.ts index 910600cb54bc..51d26a107eab 100644 --- a/packages/@tailwindcss-upgrade/src/template/codemods/modernize-arbitrary-values.test.ts +++ b/packages/@tailwindcss-upgrade/src/template/codemods/modernize-arbitrary-values.test.ts @@ -22,16 +22,6 @@ test.each([ ['[p_&]:flex', 'in-[p]:flex'], ['[.foo_&]:flex', 'in-[.foo]:flex'], ['[[data-visible]_&]:flex', 'in-data-visible:flex'], - // Some extreme examples of what happens in the wild: - ['group-[]:flex', 'in-[.group]:flex'], - ['group-[]/name:flex', 'in-[.group\\/name]:flex'], - - // These shouldn't happen in the real world (because compound variants are - // new). But this could happen once we allow codemods to run in v4+ projects. - ['has-group-[]:flex', 'has-in-[.group]:flex'], - ['has-group-[]/name:flex', 'has-in-[.group\\/name]:flex'], - ['not-group-[]:flex', 'not-in-[.group]:flex'], - ['not-group-[]/name:flex', 'not-in-[.group\\/name]:flex'], // nth-child ['[&:nth-child(2)]:flex', 'nth-2:flex'], diff --git a/packages/@tailwindcss-upgrade/src/template/codemods/modernize-arbitrary-values.ts b/packages/@tailwindcss-upgrade/src/template/codemods/modernize-arbitrary-values.ts index 7398580e3f2d..3efa3f5ddd38 100644 --- a/packages/@tailwindcss-upgrade/src/template/codemods/modernize-arbitrary-values.ts +++ b/packages/@tailwindcss-upgrade/src/template/codemods/modernize-arbitrary-values.ts @@ -28,31 +28,6 @@ export function modernizeArbitraryValues( } } - // Promote `group-[]:flex` to `in-[.group]:flex` - // ^^ Yes, this is empty - // Promote `group-[]/name:flex` to `in-[.group\/name]:flex` - if ( - variant.kind === 'compound' && - variant.root === 'group' && - variant.variant.kind === 'arbitrary' && - variant.variant.selector === '&:is()' - ) { - // `group-[]` - if (variant.modifier === null) { - changed = true - Object.assign(variant, designSystem.parseVariant('in-[.group]')) - } - - // `group-[]/name` - else if (variant.modifier.kind === 'named') { - changed = true - Object.assign( - variant, - designSystem.parseVariant(`in-[.group\\/${variant.modifier.value}]`), - ) - } - } - // Expecting an arbitrary variant if (variant.kind !== 'arbitrary') continue