#Need to update tailwindcss at @astrojs/tailwind
2 messages · Page 1 of 1 (latest)
I understand you're having an issue with updating Tailwind CSS to version 4 while using the @astrojs/tailwind integration. The warning you're seeing indicates a peer dependency conflict.
Based on the knowledge sources, the current @astrojs/tailwind integration (version 6.0.0) is designed to work with Tailwind CSS v3 (specifically ^3.0.24), but you're trying to use it with Tailwind v4.0.14, which is causing the compatibility warning.
For Astro 5.2.0 and later, there's a specific approach for using Tailwind v4:
Instead of using the standard @astrojs/tailwind integration, you should use the official Vite plugin for Tailwind v4. According to the documentation:
"Tailwind support in Astro is provided by a Vite plugin. To install the plugin in Astro >=5.2.0, use the astro add tailwind command for your package manager. For earlier versions of Astro, follow the instructions to install the official Vite plugin manually." Styles and CSS
There's also a community integration specifically for Tailwind v4 mentioned in the integrations directory:
- astro-tailwind-v4: "Adds Astro support for Tailwind v4" Integrations
To resolve this issue, you have two options:
- Use the Vite plugin approach if you're on Astro 5.2.0+
- Try the community integration astro-tailwind-v4
For the first option, you would run:
npx astro add tailwind