-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Tailwind: className prop given on buttons is ignored when using tailwind-merge for any property defined in global theme. #7760
Labels
Component: Tailwind
Tailwind specific issue
Comments
Current workaround is to provide the tailwind class with an important marker. <Button className={"!hidden"} /> |
PR is welcome. |
It looks like this is in a lot of components if you grep for |
timcostroproots
added a commit
to timcostroproots/primereact
that referenced
this issue
Mar 5, 2025
~ enable easier tailwind override (I hope)
My proposed fix does not work as expected, when switching places the global styles don't get applied at all. |
timcostroproots
added a commit
to timcostroproots/primereact
that referenced
this issue
Mar 5, 2025
This reverts commit 9d9d112.
timcostroproots
added a commit
to timcostroproots/primereact
that referenced
this issue
Mar 6, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
className
prop given on buttons is ignored when using tailwind-merge for any property defined in global theme.Reproducer
No response
System Information
Steps to reproduce the behavior
Using tailwind and tailwind merge
I noticed this with the current
<Button>
and the<SplitButton>
components, the latter having the issue both onbuttonClassName
andmenuButtonClassName
.For example, I define my global styles in a theming file as such:
But if I then want to hide my
<Button className={'hidden'}/>
tailwind-merge will choose the className from the context instead of the one defined on the element.Expected behavior
I believe the issue will be fixed when the order of the following injections is swapped:
The text was updated successfully, but these errors were encountered: