Skip to content

Commit

Permalink
feat(preset-mini): enable multipass on combinator variants
Browse files Browse the repository at this point in the history
  • Loading branch information
chu121su12 committed Jun 25, 2022
1 parent af210bc commit 01a94c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/preset-mini/src/variants/combinators.ts
Expand Up @@ -15,6 +15,7 @@ const scopeMatcher = (strict: boolean, name: string, template: string): VariantO
}
}
},
multiPass: true,
}
}

Expand Down
2 changes: 2 additions & 0 deletions test/__snapshots__/preset-mini.test.ts.snap
Expand Up @@ -373,6 +373,7 @@ div:hover .group-\\\\[div\\\\:hover\\\\]-\\\\[combinator\\\\:test-4\\\\]{combina
.c-\\\\$color-variable,
.c-\\\\$color-variable\\\\/\\\\$opacity-variable,
.c-\\\\$color-variable\\\\/10{color:var(--color-variable);}
.checked\\\\:next\\\\:hover\\\\:text-slate-500:hover+*:checked{--un-text-opacity:1;color:rgba(100,116,139,var(--un-text-opacity));}
.checked\\\\:next\\\\:text-slate-100+*:checked{--un-text-opacity:1;color:rgba(241,245,249,var(--un-text-opacity));}
.color-\\\\$red{color:var(--red);}
.color-blue,
Expand All @@ -390,6 +391,7 @@ div:hover .group-\\\\[div\\\\:hover\\\\]-\\\\[combinator\\\\:test-4\\\\]{combina
.in-range\\\\:color-pink-100:in-range,
.open\\\\:color-pink-100[open],
.out-of-range\\\\:color-pink-100:out-of-range{--un-text-opacity:1;color:rgba(252,231,243,var(--un-text-opacity));}
.next\\\\:checked\\\\:children\\\\:text-slate-600>*:checked+*{--un-text-opacity:1;color:rgba(71,85,105,var(--un-text-opacity));}
.next\\\\:checked\\\\:text-slate-200:checked+*{--un-text-opacity:1;color:rgba(226,232,240,var(--un-text-opacity));}
.placeholder-color-red-1::placeholder,
.text-red-100,
Expand Down
4 changes: 3 additions & 1 deletion test/assets/preset-mini-targets.ts
Expand Up @@ -883,9 +883,11 @@ export const presetMiniTargets: string[] = [
'[@supports(display:grid)]:bg-red/33',
'[@supports(display:grid)]:[*+&]:bg-red/34',

// variants - tagged & pseudo
// variants - combinators + pseudo
'checked:next:text-slate-100',
'next:checked:text-slate-200',
'checked:next:hover:text-slate-500',
'next:checked:children:text-slate-600',

// variants - multiple parents
'sm:lt-lg:p-10',
Expand Down

0 comments on commit 01a94c8

Please sign in to comment.