Skip to content

Commit a244317

Browse files
committed
--value(…) usage is required in functional utilities
Otherwise if you don't do that: ```css @Utility foo-* { color: red; } ``` Then `foo-a`, `foo-b`, and `foo-c` will resolve to: ```css .foo-a { color: red; } .foo-b { color: red; } .foo-c { color: red; } ``` Which seems useless because this creates unnecessary duplicate CSS.
1 parent a17b541 commit a244317

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/tailwindcss/src/utilities.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6233,8 +6233,9 @@ export function createCssUtility(node: AtRule) {
62336233
node.value = ValueParser.toCss(valueAst)
62346234
})
62356235

6236-
// Used `--value(…)` but nothing resolved
6237-
if (usedValueFn && !resolvedValueFn) return null
6236+
// Functional CSS utilities require `--value(…)`, and one of those
6237+
// branches must resolve for the candidate to be valid.
6238+
if (!usedValueFn || !resolvedValueFn) return null
62386239

62396240
// Used `--modifier(…)` but nothing resolved
62406241
if (usedModifierFn && !resolvedModifierFn) return null

0 commit comments

Comments
 (0)