We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@utility
When defining custom functional @utility with the same name for different purposes results in unwanted behavior.
If you want to use the same name, similar to how we can use text-red-500 and text-2xl then the order matters and only the first one "wins" right now.
text-red-500
text-2xl
@utility foo-* { color: --value(--color- *); } @utility foo-* { font-size: --spacing(--value(number)); }
In this case, foo-red-500 will work, but foo-123 will not.
foo-red-500
foo-123
Play: https://play.tailwindcss.com/1VmWKocy9O?file=css
If you swap the order, then foo-123 will win, but foo-red-500 won't result in anything.
@utility foo-* { font-size: --spacing(--value(number)); } @utility foo-* { color: --value(--color- *); }
Play: https://play.tailwindcss.com/71oBj8xrI1?file=css
The expected behavior is that both work.
The text was updated successfully, but these errors were encountered:
Defining both properties in the same utility works
@utility foo-* { font-size: --spacing(--value(number)); color: --value(--color- *); }
Sorry, something went wrong.
Yep you are correct! And that's also what we do internally for core plugins, but I think there is still something nice about separating them.
Play with combination: https://play.tailwindcss.com/OUN74Zyn9S?file=css
No branches or pull requests
When defining custom functional
@utility
with the same name for different purposes results in unwanted behavior.If you want to use the same name, similar to how we can use
text-red-500
andtext-2xl
then the order matters and only the first one "wins" right now.In this case,
foo-red-500
will work, butfoo-123
will not.Play: https://play.tailwindcss.com/1VmWKocy9O?file=css
If you swap the order, then
foo-123
will win, butfoo-red-500
won't result in anything.Play: https://play.tailwindcss.com/71oBj8xrI1?file=css
The expected behavior is that both work.
The text was updated successfully, but these errors were encountered: