Skip to content

Commit 614bf85

Browse files
committed
ensure modifiers are unique
For the `mask-*` utilities, we do call `suggest(…)` multiple times, so there could be some duplication. The `modifiers` are a simple array and not a Set so let's make them unique here. Ideally we don't call suggest with the same values, but that requires a bigger internal refactor. Another ideal situation would be if `modifiers` was a Set in the first place. But since it's export and "public" API I didn't want to change that datastructure.
1 parent 35a989f commit 614bf85

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/tailwindcss/src/intellisense.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ export function getClassList(design: DesignSystem): ClassEntry[] {
5555
item.fraction ||= fraction
5656
item.modifiers.push(...group.modifiers)
5757
}
58+
59+
// Deduplicate modifiers
60+
item.modifiers = Array.from(new Set(item.modifiers))
5861
}
5962
}
6063
}

0 commit comments

Comments
 (0)