Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Commit

Permalink
Simplify changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Mar 27, 2021
1 parent 55eb739 commit 20af816
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/lib/generateRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,15 @@ 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) => {
return `!${className}`
})
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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 20af816

Please sign in to comment.