Skip to content

Commit 3037a11

Browse files
utilities: auto-suggest staticValues in functionalUtility; keep suggestions non-negative and merge with existing groups
1 parent a8409d5 commit 3037a11

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/tailwindcss/src/utilities.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,13 @@ export function createUtilities(theme: Theme) {
460460
supportsFractions: desc.supportsFractions,
461461
},
462462
])
463+
464+
// Also suggest any staticValues automatically so callers don't need to
465+
// manually add suggestion groups for e.g. `auto`, `none`, `full`, etc.
466+
if (desc.staticValues && Object.keys(desc.staticValues).length > 0) {
467+
let values = Object.keys(desc.staticValues)
468+
suggest(classRoot, () => [{ values }])
469+
}
463470
}
464471

465472
type ColorUtilityDescription = {

0 commit comments

Comments
 (0)