-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[v4] Clarify browser support #14119
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
Comments
I agree that several steps need to be taken to ensure a smooth transition for users. Here are a few key points to consider:
By taking these steps, we can ensure that the transition to Tailwind v4 will be smooth and not cause significant disruptions for existing users. |
Hey! The documentation and upgrade guide will definitely be clear about all of this. We only do major versions every few years so we try to always use them as an opportunity to jump on fairly new platform features so that two or three years down the road the framework is already ready for them and we don't feel like we have to pump out a new major version every 12 months. This was also the case with Tailwind CSS v2.0 where CSS variable support became a requirement to use the framework. A lot of people weren't totally comfortable with them yet, but now in 2024 we'd look like a framework from the stone age if we weren't taking advantage of them. @ottomated: As you mentioned in another comment, features we're depending on have 85% audience coverage at the moment according to Browserslist: The recommended https://browsersl.ist/#q=defaults So it's a little bit less, but I think it'll catch up a bit by the time we actually release Tailwind CSS v4.0 around ~December. I also think these numbers are maybe a bit inaccurate right now, because I'm surprised they are recommending a configuration that has < 90% coverage, which makes me think that the delta between our requirements and "Can I use…" reports 93.37% coverage for the Either way like I've already mentioned we'll be very clear about browser support when the release is ready, and for folks who can't migrate right away because they still need to support older browsers, Tailwind CSS v3 will continue to be a good choice until adoption of more modern browsers catches up. Appreciate the feedback either way and we can always revisit some of the properties we're depending on or things we should consider trying to polyfill if our browser targets are too bleeding edge for the majority of users. |
Unfortunately neither the migration guide nor the announcement blog mention the minimum browser support. Maybe also mention whether it supports Baseline? |
I think we need to understand the browser support, otherwise some key projects will not dare to upgrade tailwind to the latest version and experience the better experience it brings us. |
@sdavids @beiatisi We have a page for compatibility that mentions the browser support as the first thing: https://tailwindcss.com/docs/compatibility |
Maybe you could add a link to that page in the migration guide to make it easier to find. Also, you might want to:
Should I create a new issue for these suggestions? – Considering this issue is closed? |
I definitely got bitten by the higher than expected compatibility requirement. All I saw was "run this npx package and you'll be automatically upgraded"; if there was a compatibility message, I didn't see it. I'm on a project where the device I'm developing for is pinned to Chrome 87; not terribly old, but definitely out of range of the Chrome 111 (which I found after upgrading). The issue being that things like native cascading layers, OKLab colours, etc. aren't supported that far back. I tried some PostCSS plugins that at least got the site rendering with styles, but so many things were broken I had to revert it. For projects like mine, it'll be impossible to upgrade to Tailwind 4 without some compatibility settings or a compatibility plugin. I don't mind "legacy" browsers not being the initial target, but support should make it's way backwards eventually. Chrome 87 was from late 2020 and there are potentially millions of devices still running it, meaning new tailwind sites could be breaking on them with no recourse. |
Just going to leave that here for anyone who dares to tinker: https://gist.github.com/alexanderbuhler/2386befd7b6b3be3695667cb5cb5e709 @Soviut what parts of your project didn't work properly? Polyfilling |
@alexanderbuhler #14094 is an issue too |
@ottomated Added this to the gist today. Appreciate you pointing that out to me! |
Unless you have a hard requirement to support old browsers, I can recommend using |
@alexanderbuhler Have ani tip for use the Gist? tried everything to add this to my laravel 12 + tailwind v4 project, but didn't work. |
In my case, I have to support older browsers, but I don't want to stick with Tailwind 3 just because of it. I made two changes to the setup that improved the backwards compatibility. It's not perfect, but decent enough. Check out this repo where I document those changes. |
Saved my life bro, thx! I was needing the compatibility with 109 version of Google Chrome! |
@wevertondcl My gist assumes that you have a PostCSS processing step in your build pipeline. |
Tailwind v4 seems to be taking a different direction for browser support than v3, using some pretty bleeding-edge CSS features for common utilities rather than just providing APIs for them. This is fine, but requires:
transform
that lightningcss does not support (Individual transforms can't get converted to compatible syntax by lightningcss #14094)I think this issue will be more pervasive upon release given that v4 will support backwards compatibility for config files and might be mistakenly seen as a drop-in replacement.
The text was updated successfully, but these errors were encountered: