From 3192f2a007e846a7edfb70681effa31699b5e51f Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Mon, 9 May 2022 16:45:11 -0400 Subject: [PATCH] Use object in recordCandidates --- src/lib/generateRules.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/generateRules.js b/src/lib/generateRules.js index 836945f16..b716f42c5 100644 --- a/src/lib/generateRules.js +++ b/src/lib/generateRules.js @@ -345,9 +345,15 @@ function* resolveMatchedPlugins(parsed, context) { } } -function* recordCandidates(matches, classCandidate) { +function* recordCandidates(matches, candidate) { for (const match of matches) { - match[1].raws.tailwind = { ...match[1].raws.tailwind, classCandidate } + match[1].raws.tailwind = { + ...match[1].raws.tailwind, + classCandidate: candidate.withoutVariants, + + // todo: rename? + parsedCandidate: candidate, + } yield match } @@ -472,7 +478,7 @@ function* resolveMatches(candidate, context) { } matches = matches.flat() - matches = Array.from(recordCandidates(matches, classCandidate)) + matches = Array.from(recordCandidates(matches, parsed)) matches = applyPrefix(matches, context) if (important) {