Skip to content
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

[chore]: Upgrade to TailwindCSS v4 #6427

Open
2 tasks done
felipegomss opened this issue Jan 23, 2025 · 11 comments
Open
2 tasks done

[chore]: Upgrade to TailwindCSS v4 #6427

felipegomss opened this issue Jan 23, 2025 · 11 comments

Comments

@felipegomss
Copy link

Feature description

Request to upgrade the project dependency to TailwindCSS v4 to ensure compatibility, leverage new features, and improve performance.

Follow the TailwindCSS Upgrade Guide to streamline the update process.

Affected component/components

No response

Additional Context

Additional details here...

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues and PRs
@Geezgus
Copy link

Geezgus commented Jan 23, 2025

I believe you can update tw in your project by yourself without much-if-any problem

@diegotraid
Copy link

I believe you can update tw in your project by yourself without much-if-any problem

There are some renamed utility classes on v4 which will "break" some styles on shadcn-ui components.

@cktang88
Copy link

part of this is to update the docs too, eg. Vite docs need to use the new Tailwind vite plugin

@MayankFawkes
Copy link

part of this is to update the docs too, eg. Vite docs need to use the new Tailwind vite plugin

True

@leonardomso
Copy link

leonardomso commented Jan 23, 2025

You can use Tailwind v4 for now, just make sure you check some renamed utilities and rename them correctly in your project. If your custom colors are not being applied, make sure to import the tailwind config file into your globals.css file.

@config '../tailwind.config.ts';

Anyway, just some turnaround for now. For bigger projects it's better to wait for official support and new docs from shadcn.

@PassPuff
Copy link

I upgraded Tailwind to v4
After that I wanted to install shadcn@latest

I get the error

npx shadcn@latest init -d
✔ Pre-flight checks.
✔ Checking framework. Found Next.js.
✖ CSS Tailwind validity check.
✔ Import alias validation.

The Tailwind CSS configuration is not found in /Users/nik/frontend.
You probably do not have Tailwind CSS installed or its configuration is incorrect.
Install Tailwind CSS and try again.
Visit https://tailwindcss.com/docs/guides/nextjs to get started.

@bangonkali
Copy link

bangonkali commented Jan 23, 2025

I upgraded Tailwind to v4 After that I wanted to install shadcn@latest

I get the error

npx shadcn@latest init -d ✔ Pre-flight checks. ✔ Checking framework. Found Next.js. ✖ CSS Tailwind validity check. ✔ Import alias validation.

The Tailwind CSS configuration is not found in /Users/nik/frontend. You probably do not have Tailwind CSS installed or its configuration is incorrect. Install Tailwind CSS and try again. Visit https://tailwindcss.com/docs/guides/nextjs to get started.

You will need to still include the following: (do not remove it)

@tailwind base;
@tailwind components;
@tailwind utilities;

so CSS Tailwind validity check works.

@alfinauzikri
Copy link

@PassPuff You can solve the problem by downgrading to TailwindCSS v3. #6434

@stevenjburrows
Copy link

I upgraded Tailwind to v4 After that I wanted to install shadcn@latest
I get the error
npx shadcn@latest init -d ✔ Pre-flight checks. ✔ Checking framework. Found Next.js. ✖ CSS Tailwind validity check. ✔ Import alias validation.
The Tailwind CSS configuration is not found in /Users/nik/frontend. You probably do not have Tailwind CSS installed or its configuration is incorrect. Install Tailwind CSS and try again. Visit https://tailwindcss.com/docs/guides/nextjs to get started.

You will need to still include the following: (do not remove it)

@tailwind base;
@tailwind components;
@tailwind utilities;
so CSS Tailwind validity check works.

This never worked for me, I also had to add a tailwind.config.ts file to the root for it to work but I did add them just to make sure.

@bdrtsky
Copy link

bdrtsky commented Jan 27, 2025

You can't use Shadcn at least until Tailwind Merge support of Tailwind 4. As for CLI I think it could take even longer.

@cktang88
Copy link

cktang88 commented Jan 27, 2025

Tailwind Merge support should be out in a few days according to dcastil/tailwind-merge#513

I expect to add support for it a few days after the Tailwind CSS v4 release. Most probably it will be a new major tailwind-merge version with the only breaking change being that it supports Tailwind CSS v4 instead of v3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests