-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
[BUG] classNames are ignored in v5.13.0 #1025
Comments
Hi, I tested here and the issue is:
CSS works like objects, when we pass a custom class, this is the behavior: Before
On version
this is a Solution 1 -> you need to increase the CSS specificity from your side - I don't like to force the community using our library to write extra code Solution 2 -> we need to increase the specificity of the CSS received by props (how?) - I prefer this approach, but I don't have any ideas on how to do that at the moment - edit: as far as I checked, it's not possible, the best solution to fix this bug is solution 1. I'll wait for the community if someone has some suggestions to fix this issue. I really don't want to do a rollback of the feature to inject style by default instead of importing CSS. reference: https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity |
#1027 suggests a workaround |
yeah, that workaround is just the dev increasing the specificity of his CSS query, it's the solution 1 that I mentioned. another way to do that together with taiwlind is:
|
Hey guys, I don't think that's problem with the current version. Tailwind classes were ignored with [email protected]. This is why I had to create separate CSS class like: .tooltipWrapper {
@apply rounded-lgplus bg-tixy-1000 p-2 text-sm font-normal leading-4 text-tixy-10 shadow-sm;
} or with the current version: .tooltipWrapper[role="tooltip"] {
@apply rounded-lgplus bg-tixy-1000 p-2 text-sm font-normal leading-4 text-tixy-10 shadow-sm;
} |
Edit: Thank you for the solution, Tomekmularczyk, I didn't understand it correctly at first. It's working perfectly!
There is definitely a problem with the current version 5.13.0. Everything works fine with version 5.12.0. |
@danielbarion , how to completely remove default styling of tooltip? We use this lib hardly in our project, but every time I need to find some crazy way to override it's internal stylings :( Why just not add |
@NemeZZiZZ There's no equivalent to a <Tooltip style={myCustomStyle} /> |
Daniel did it on my request for v4 just before v5. |
That's totally understandable, but by our experience this hasn't been an issue to the package users in general. You're welcome to open a PR with a rough idea of how you suggest we do this (doesn't have to be perfect, just enough to get the idea) so we can better discuss it. |
@NemeZZiZZ, as I said before, we are trying to not roll back the decision to inject the styles by default, but when reading your comments, I started to think about refactoring the inject the styles function. Today:
The refactored code:
This change will also give us more control, like the style injection inside of web components as example. I don't promise, but I'll try to take a look at this as soon as possible. |
hey @NemeZZiZZ @gabrieljablonski, I need help here: #1041 :) |
@NemeZZiZZ please check: #1041 (comment) |
I'm sorry for being late with no support. |
Available at v5.16.0 - please note to use v5.16.1 ;) I'll close this issue as resolved, @NemeZZiZZ and @ansgarsteinkamp please feel free to open a new issue if needed, |
Edit: The solution of Tomekmularczyk is working perfectly! @danielbarion In version 5.16.1, the issue remains unchanged. |
Bug in v5.13.0: classNames like the Tailwind-Class
bg-blue-900
are ignored somehow:With v5.12.0 everything works just fine.
The text was updated successfully, but these errors were encountered: