Closed GabeConsalter closed 8 months ago
This is not a tailwind-variants bug, rather you'll need to configure tailwind-merge with your custom colors so it knows how to merge the classes properly. cva
doesn't use tailwind-merge which is why it doesn't have the same issue.
You can read about configuring tailwind merge in the docs:
Thanks @mskelton. I didn't know there was this need for configuration with tailwind-merge. Do you have some link from docs about it?
@GabeConsalter I posted links in my comment above.
Describe the bug Hello everyone, I've been using tailwind-variants and noticed a possible issue. When trying to use one variant to determine the text size and another variant to determine the text color, only the last color variant is applied in the final result, perhaps due to the className being the same with text-*.
This example code:
To Reproduce Steps to reproduce the behavior:
Expected behavior When combining text size and color variants using tailwind-variants, both variants should be applied successfully to the text, resulting in the specified size and color. Currently, only the last color variant is taking effect, and the expected behavior is to have both variants applied simultaneously.
Screenshots The text size variant was not applied.
Desktop (please complete the following information):
Additional context I conducted a test using the class-variance-authority library, and there was no occurrence of the mentioned problem.
This example code:
Result: The text size variant was applied.