-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
.border trumps .border-[size] #1013
Comments
.border
trumps .border-[size]
No plans to change this behavior unfortunately as it would be quite a complex change (#1015), so instead I would recommend not adding two classes that target the same property, and only have either If you can share more about the tech you are using to build your project I'm happy to help come up with a solution for doing this that doesn't feel too cumbersome. |
No worries, I can make do with doing some ternary assignments in this case. I'm running into it with some PHP templates/views where, depending on certain variables, I add classes to elements. To give you an example:
But that's easily converted to
So it was more a "cascade" question than a necessity on my end ;) The only issue I see is when you extract a component (i.e. |
Going through #1015 I'm wondering if you couldn't just hoist the Disclaimer: I haven't looked at the source, so I'm just spit-balling. |
@TheDutchCoder Definitely possible to do that! I was giving that solution some thought, but realized that in the end it just imposes a different cascade order on the user ( It would also lead to some inconsistency with other plugins, specifically If we hoist out |
@AlexVipond I understand what you're saying. However since Not trying to introduce breaking changes of course, but it would be more consistent when it comes to 'defaults' I would think. The Anyway, it's a bit of a minor issue, I understand, but it did throw me off quite a bit as I didn't expect the behaviour (as I find Tailwind to be extremely predictable in a very, very good way). Food for thought! ;) |
Howdy!
Would it be possible to have the default
.border
class be defined before any of the individual widths? Currently this doesn't work:<div class="border border-2">
which is unfortunate, because I dynamically insert certain classes to "override" the defaults.I can currently get away by also dynamically assigning the default border, but I think it would be consistent to not having to do so.
Cheers!
The text was updated successfully, but these errors were encountered: