-
Notifications
You must be signed in to change notification settings - Fork 41
[Idea] - Arbitrary values with !important #34
Comments
I have often longed for this for exactly the same reasons. I've found a workaround is to add a custom class to the element, apply the tailwind class you want to override with @apply, then it should allow you to override it back in the inline class for element.
then it can be used like:
(block/flex might be a bad example here if the specificity is already fine but you get the idea) |
Yes, I've also gone through similar length to get my specificity higher than that of the library. Even sometimes being almost the only custom CSS styles of the app. It's also annoying because then I'll have to think about how/where to name/put it. We shall see ✌🏾 |
Yeah planning to add this as a core feature likely looking like |
That would be a great addition |
@adamwathan Seems that the example |
Added first class support for |
I've encountered a few situations in the pass where I needed an
!important
statement with Tailwind on exactly one element, and other times a few elements.And in those cases my needs did not warrant setting the important config value to true.
These situation arises mostly when working with third party libraries where their CSS specificity beats that of Tailwind's.
So I'm thinking something like:
!bg-primary
,bg-primary!
,bg-primary!important
or to be consistent with the opt in arbitrary values syntax:bg-primary[!]
, could be a nice solution.Any feedback appreciated :)
The text was updated successfully, but these errors were encountered: