Skip to content

Commit 2a6f6b8

Browse files
Add matchVariant API
1 parent 8c6c291 commit 2a6f6b8

File tree

3 files changed

+1153
-2
lines changed

3 files changed

+1153
-2
lines changed

packages/tailwindcss/src/candidate.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,15 @@ export function parseVariant(variant: string, designSystem: DesignSystem): Varia
572572
}
573573

574574
case 'functional': {
575-
if (value === null) return null
575+
if (value === null) {
576+
return {
577+
kind: 'functional',
578+
root,
579+
modifier: modifier === null ? null : parseModifier(modifier),
580+
value: null,
581+
compounds: designSystem.variants.compounds(root),
582+
}
583+
}
576584

577585
if (value[0] === '[' && value[value.length - 1] === ']') {
578586
return {

0 commit comments

Comments
 (0)