Skip to content
Prev Previous commit
Next Next commit
utilities: auto-suggest staticValues in functionalUtility; keep sugge…
…stions non-negative and merge with existing groups
  • Loading branch information
philipp-spiess committed Sep 11, 2025
commit 3037a11616a56d39eada70a9af4ed1a9711e1ace
7 changes: 7 additions & 0 deletions packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,13 @@ export function createUtilities(theme: Theme) {
supportsFractions: desc.supportsFractions,
},
])

// Also suggest any staticValues automatically so callers don't need to
// manually add suggestion groups for e.g. `auto`, `none`, `full`, etc.
if (desc.staticValues && Object.keys(desc.staticValues).length > 0) {
let values = Object.keys(desc.staticValues)
suggest(classRoot, () => [{ values }])
}
}

type ColorUtilityDescription = {
Expand Down