Add support for important in v4#14448
Merged
Merged
Conversation
f8780bf to
ca56bde
Compare
6ffec7e to
ed8a056
Compare
thecrypticace
commented
Sep 24, 2024
thecrypticace
commented
Sep 24, 2024
thecrypticace
commented
Sep 24, 2024
a33fd23 to
f06bb16
Compare
e59d8a9 to
1971422
Compare
4b91d22 to
f27d403
Compare
75f505f to
3871ea1
Compare
philipp-spiess
left a comment
Contributor
There was a problem hiding this comment.
This all seems easy enough, just one question inline. Happy to stamp it but I feel like this could benefit from someone else's 👀 too!
RobinMalfait
approved these changes
Sep 25, 2024
This was referenced May 17, 2026
This was referenced May 25, 2026
Merged
This was referenced Jun 1, 2026
Merged
This was referenced Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows modifying utility output by wrapping all utility declarations in a custom selector or marking all utility declarations as
!important. This is the v4 equivalent to theimportantoption in thetailwind.config.jsfile.Mark all utility declarations as
!importantTo add
!importantto all utility declarations, you add animportantflag after the@importstatement fortailwindcssortailwindcss/utilities:Example utility output:
This is equivalent to adding
important: trueto thetailwind.config.jsfile — which is still supported for backwards compatibility.Wrap all utility declarations in a custom selector
For backwards compatibility, if you need to nest all utilities in an
#appselector you addimportant: "#app"to your config file:This does not bring back support for the
respectImportantflag inaddUtilities/matchUtilities.