From 20af816639a339cc1e555f1f01c46adab373049b Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Sat, 27 Mar 2021 19:32:26 -0400 Subject: [PATCH] Simplify changes --- src/lib/generateRules.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/generateRules.js b/src/lib/generateRules.js index b3fb42e..046be38 100644 --- a/src/lib/generateRules.js +++ b/src/lib/generateRules.js @@ -71,7 +71,7 @@ function applyImportant(matches) { } let result = [] - for (let [{ sort, layer, options }, rule] of matches) { + for (let [meta, rule] of matches) { let container = postcss.root({ nodes: [rule] }) container.walkRules((r) => { r.selector = updateAllClasses(r.selector, (className) => { @@ -79,8 +79,7 @@ function applyImportant(matches) { }) r.walkDecls((d) => (d.important = true)) }) - let withOffset = [{ sort: sort, layer, options }, container.nodes[0]] - result.push(withOffset) + result.push([meta, container.nodes[0]]) } return result @@ -177,9 +176,8 @@ function* resolveMatchedPlugins(classCandidate, context) { let candidatePrefix = classCandidate let negative = false - let twConfigPrefix = context.tailwindConfig.prefix || '' - let twConfigPrefixLen = twConfigPrefix.length - + const twConfigPrefix = context.tailwindConfig.prefix || '' + const twConfigPrefixLen = twConfigPrefix.length if (candidatePrefix[twConfigPrefixLen] === '-') { negative = true candidatePrefix = twConfigPrefix + candidatePrefix.slice(twConfigPrefixLen + 1)