Skip to content

Document the important option #2030

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

Merged
merged 3 commits into from
Jan 29, 2025
Merged

Document the important option #2030

merged 3 commits into from
Jan 29, 2025

Conversation

RobinMalfait
Copy link
Member

This PR adds documentation for the important option on the @import "tailwindcss"; at-rule.

Remaining questions:

  • Is this the correct spot to document this? (We redirect /docs/configuration to /docs/theme, so not 100% sure)
  • Should we document a solution for the #app selector strategy that is mentioned in the v3 docs?

Fixes: #2028

Copy link

vercel bot commented Jan 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tailwindcss-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2025 8:42pm

Comment on lines 535 to 536

The `important` option can be used to make all utilities have a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `important` option can be used to make all utilities have a

Comment on lines 540 to 544

```css
/* [!code filename:app.css] */
/* [!code word:important] */
@import "tailwindcss" important;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should also explain where to put that important if you de-sugar that import (i think it's on the @import "tailwindcss/utilities.css" right?)

@import "tailwindcss" important;
```

To generate individual utilities as `!important`, use the `!` syntax at the end of a utility class:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this has changed from v3 (where ! always appeared at the beginning of a utility class), this should be mentioned on the upgrade page as well.

@adamwathan adamwathan merged commit 3406ca0 into main Jan 29, 2025
1 of 2 checks passed
@adamwathan adamwathan deleted the feat/document-important branch January 29, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

!important docs gone from v4
4 participants