Skip to content

Commit

Permalink
Fix important variant @apply
Browse files Browse the repository at this point in the history
  • Loading branch information
bradlc committed Aug 18, 2021
1 parent 7523a44 commit 65012ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/jit/lib/generateRules.js
Expand Up @@ -103,9 +103,9 @@ function applyVariant(variant, matches, context) {
let variantFunctionTuples = context.variantMap.get(variant)
let result = []

for (let [{ sort, layer, options }, rule] of matches) {
if (options.respectVariants === false) {
result.push([{ sort, layer, options }, rule])
for (let [meta, rule] of matches) {
if (meta.options.respectVariants === false) {
result.push([meta, rule])
continue
}

Expand Down Expand Up @@ -141,7 +141,7 @@ function applyVariant(variant, matches, context) {
continue
}

let withOffset = [{ sort: variantSort | sort, layer, options }, clone.nodes[0]]
let withOffset = [{ ...meta, sort: variantSort | meta.sort }, clone.nodes[0]]
result.push(withOffset)
}
}
Expand Down
2 changes: 2 additions & 0 deletions tests/jit/apply.test.css
Expand Up @@ -323,10 +323,12 @@ h2 {
padding-left: 1rem;
padding-right: 1rem;
}

.important-modifier-variant {
padding-left: 1rem;
padding-right: 1rem;
}

.important-modifier-variant:hover {
border-radius: 0.375rem !important;
}
Expand Down

0 comments on commit 65012ec

Please sign in to comment.