Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] Utility modifiers only work with arguments #16824

Open
royduin opened this issue Feb 26, 2025 · 0 comments
Open

[v4] Utility modifiers only work with arguments #16824

royduin opened this issue Feb 26, 2025 · 0 comments

Comments

@royduin
Copy link

royduin commented Feb 26, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants