Skip to content

Commit 17c7609

Browse files
committed
Remove grouping prototype
This code has been sitting around for a while disabled and untested. And it does not work with the Oxide parser. So we’re gonna remove it.
1 parent 88119e2 commit 17c7609

File tree

4 files changed

+4
-303
lines changed

4 files changed

+4
-303
lines changed

src/featureFlags.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ let featureFlags = {
2222
experimental: [
2323
'optimizeUniversalDefaults',
2424
'generalizedModifiers',
25-
// 'variantGrouping',
2625
],
2726
}
2827

src/lib/defaultExtractor.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export function defaultExtractor(context) {
2121

2222
function* buildRegExps(context) {
2323
let separator = context.tailwindConfig.separator
24-
let variantGroupingEnabled = flagEnabled(context.tailwindConfig, 'variantGrouping')
2524
let prefix =
2625
context.tailwindConfig.prefix !== ''
2726
? regex.optional(regex.pattern([/-?/, regex.escape(context.tailwindConfig.prefix)]))
@@ -103,15 +102,7 @@ function* buildRegExps(context) {
103102

104103
prefix,
105104

106-
variantGroupingEnabled
107-
? regex.any([
108-
// Or any of those things but grouped separated by commas
109-
regex.pattern([/\(/, utility, regex.zeroOrMore([/,/, utility]), /\)/]),
110-
111-
// Arbitrary properties, constrained utilities, arbitrary values, etc…
112-
utility,
113-
])
114-
: utility,
105+
utility,
115106
])
116107
}
117108

src/lib/generateRules.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ function* recordCandidates(matches, classCandidate) {
573573
}
574574
}
575575

576-
function* resolveMatches(candidate, context, original = candidate) {
576+
function* resolveMatches(candidate, context) {
577577
let separator = context.tailwindConfig.separator
578578
let [classCandidate, ...variants] = splitWithSeparator(candidate, separator).reverse()
579579
let important = false
@@ -583,15 +583,6 @@ function* resolveMatches(candidate, context, original = candidate) {
583583
classCandidate = classCandidate.slice(1)
584584
}
585585

586-
if (flagEnabled(context.tailwindConfig, 'variantGrouping')) {
587-
if (classCandidate.startsWith('(') && classCandidate.endsWith(')')) {
588-
let base = variants.slice().reverse().join(separator)
589-
for (let part of splitAtTopLevelOnly(classCandidate.slice(1, -1), ',')) {
590-
yield* resolveMatches(base + separator + part, context, original)
591-
}
592-
}
593-
}
594-
595586
// TODO: Reintroduce this in ways that doesn't break on false positives
596587
// function sortAgainst(toSort, against) {
597588
// return toSort.slice().sort((a, z) => {
@@ -780,7 +771,7 @@ function* resolveMatches(candidate, context, original = candidate) {
780771
match[1].raws.tailwind = { ...match[1].raws.tailwind, candidate }
781772

782773
// Apply final format selector
783-
match = applyFinalFormat(match, { context, candidate, original })
774+
match = applyFinalFormat(match, { context, candidate })
784775

785776
// Skip rules with invalid selectors
786777
// This will cause the candidate to be added to the "not class"
@@ -794,7 +785,7 @@ function* resolveMatches(candidate, context, original = candidate) {
794785
}
795786
}
796787

797-
function applyFinalFormat(match, { context, candidate, original }) {
788+
function applyFinalFormat(match, { context, candidate }) {
798789
if (!match[0].collectedFormats) {
799790
return match
800791
}

tests/variant-grouping.test.skip.js

Lines changed: 0 additions & 280 deletions
This file was deleted.

0 commit comments

Comments
 (0)