Support for the Tailwind v4
Version 4 of tailwind css will replace version 3 sooner or later.
- Right now using version 4 completely breaks manganis.
- When cargo check finishes the tailwind 4 server terminates.
- It is impossible to use Tailwind CDN because it does not exist.
Steps to reproduce the behavior: Using the CLI
npm install tailwindcss@next @tailwindcss/cli@next
Next, import Tailwind in your input.css file:
@import "tailwindcss";
npx @tailwindcss/cli@next -i ./input.css -o ./assets/tailwind.css --watch
https://github.com/user-attachments/assets/c93a6c83-83c5-4b39-8988-53ef4faba893
Dioxus version: 0.6.0-alpha.2 Rust version: rustc 1.81.0 OS info: Win11 App platform: web
Now v4 is the default for new installations!
tailwind v4 seems to be working, but not fully, testing some classes like setting text size and font styles are not working for me, I'm not sure why.
tailwind v4 seems to be working, but not fully, testing some classes like setting text size and font styles are not working for me, I'm not sure why.
Not sure if you have the same problem as me but i got my setup working by changing
@tailwind base; @tailwind components; @tailwind utilities;
to
@import "tailwindcss";
in my input.css
and running
npx @tailwindcss/cli [...]
instead of
npx tailwindcss [...]
It is documented this way on the tailwind v4 doc for the cli version
Thanks @tsager25! This helped me!
It was very confusing to init a new application with tailwind and it not working. Thanks for workaround.
tailwind v4 seems to be working, but not fully, testing some classes like setting text size and font styles are not working for me, I'm not sure why.
Not sure if you have the same problem as me but i got my setup working by changing
@tailwind base; @tailwind components; @tailwind utilities;to
@import "tailwindcss";in my
input.cssand running
npx @tailwindcss/cli [...]instead of
npx tailwindcss [...]It is documented this way on the tailwind v4 doc for the cli version
Although there is no error, the vast majority of classes in tailwindss do not work
Can you give an example of classes that don't work?? For me so far I haven't encountered any. Or I am extremely lucky? Isn't it just a matter of the already existing CSS files (created in the dx new project) overriding the tailwind classes?
I do use Tailwind 4 atm, in combination with Dioxus
The steps that I used to get Tailwind v4.1.8 working with Dioxus v0.6.3 were:
npm install tailwindcss- Change your
input.cssto contain nothing other than@import "tailwindcss"; - And the new watch command is as follows:
npx @tailwindcss/cli -i ./input.css -o ./assets/tailwind.css --watch
@Legorooj VM13:3 Not allowed to load local resource: file:///F:/Temp/rust/test/src/assets/tailwind.css