Skip to content

Conversation

@MichaHuhn
Copy link
Contributor

Upgrade Tailwind from version 3 to 4.

Tailwind 4 provides a simpler installation setup and offers some new features.

That's the installation guide for Tailwind version 4: https://tailwindcss.com/docs/installation/using-vite

Copy link
Contributor

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

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

I am surprised the upgrade script messed up those deps? Have you done the upgrade manually?

@MichaHuhn
Copy link
Contributor Author

I didn't use the upgrade script to avoid potential conflicts.
I uninstalled Tailwind instead and then installed Tailwind 4.

Based on the installation guide, those dependencies need to be installed as normal dependencies, right?
image

@danieldietzler
Copy link
Contributor

danieldietzler commented Jul 20, 2025

That doesn't make sense to me. Vite is a dev dependency already, so @tailwindcss/vite wouldn't work anyways. Plus, in all projects I'm working on those are dev dependencies and it works perfectly fine.

It also makes sense: What the two do is simply generate CSS files and throw them into the build output. At runtime neither package is needed (which is good because having the entire tailwind lib in prod would be kind of annoying if you only use a couple of classes, hence tree shaking).

I have no idea why the docs would mess this up.

@MichaHuhn
Copy link
Contributor Author

I agree. I just followed the docs.

@sebinside
Copy link
Owner

There seems to be an ongoing discussion about this: tailwindlabs/tailwindcss#13854

Nevertheless, I would also opt for keeping tailwind in the dev dependencies.

@MichaHuhn
Copy link
Contributor Author

MichaHuhn commented Jul 21, 2025

Weird that they didn't update the docs after this discussion.
They are now in the devDependencies.

The Dependabot updates created a merge conflict, so it's probably best if you resolve it @sebinside.

@sebinside sebinside merged commit 399a394 into sebinside:develop Aug 3, 2025
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.

3 participants