Skip to content

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Aug 1, 2025

In v4 we made a change that makes elements with a hidden attribute display: none !important. A consequence of this is that <div hidden class="block">test</div> will be invisible in v4 where it was visible in v3.

The intent is that you must remove this attribute if the element isn't actually meant to be hidden but we didn't document this in the upgrade guide or the preflight page.

Closes tailwindlabs/tailwindcss#18653

Copy link

vercel bot commented Aug 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
tailwindcss-com Ready Ready Preview Comment Sep 8, 2025 3:45pm

Copy link

@maiieul maiieul left a comment

Choose a reason for hiding this comment

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

A small typo. Otherwise LGTM!

}
```

This enfoces that elements with a `hidden` attribute stay invisible unless using `hidden="until-found"`. The should *remove* the `hidden` attribute if you want an element to be visible to the user.
Copy link

Choose a reason for hiding this comment

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

The should -> You should

@maiieul
Copy link

maiieul commented Aug 13, 2025

P.S. imo the issue should be converted to a discussion instead of just closed, as there seem to be strong arguments against this breaking change.

}
```

This enfoces that elements with a `hidden` attribute stay invisible unless using `hidden="until-found"`. The should *remove* the `hidden` attribute if you want an element to be visible to the user.
Copy link
Contributor

Choose a reason for hiding this comment

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

This enfoces -> This enforces

@philipp-spiess philipp-spiess merged commit dc9e786 into main Sep 11, 2025
2 checks passed
@philipp-spiess philipp-spiess deleted the feat/upgrade-guide-preflight-hidden branch September 11, 2025 15:00
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.

v4 preflight adds !important on [hidden] attribute, unexpectedly preventing override
4 participants