-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[v4] Utility modifiers only work with arguments #16824
Copy link
Copy link
Open
Description
With Tailwind 4 (4.0.9 currently); modifiers only seem to work with utilities that do have an argument, this works:
@utility text-* {
--alpha: calc(--modifier(integer) * 1%);
color: --alpha(--value(--*, [color]) / var(--alpha, 100%));
}With text-default, text-default/50, text-blue, text-blue/50, etc.
This doesn't work:
@utility text {
--alpha: calc(--modifier(integer) * 1%);
color: --alpha(red / var(--alpha, 100%));
}With just text, text/50, etc. as the modifier isn't parsed.
Demo: https://play.tailwindcss.com/ECphsE1vzA?file=css
Related discussion: #15775
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels