Update tailwind.md
Fixed input.css file for tailwind version 4 see here https://github.com/DioxusLabs/dioxus/issues/3286#issuecomment-2518970010
-
Is this still needed https://github.com/DioxusLabs/docsite/blob/84a6dfc386efab020def4f597d70126e689222fd/docs-src/0.6/src/cookbook/tailwind.md?plain=1#L35 or is it
v0.5.*specific? Related to https://github.com/DioxusLabs/docsite/issues/435 -
Is
tailwind.config.jsneeded at all forv4?
Getting an error with these changes
Before:
@tailwind base;
@tailwind components;
@tailwind utilities;
root@c-nixos:/workspaces/voyver_website (master)$ npx tailwindcss -i ./input.css -o ./assets/tailwind.css --watch
≈ tailwindcss v4.0.4
Done in 131ms
^C
After:
@import "tailwindcss";
@source "./src/**/*.{rs,html,css}";
root@c-nixos:/workspaces/voyver_website (master)$ npx tailwindcss -i ./input.css -o ./assets/tailwind.css --watch
Error: Can't resolve 'tailwindcss' in '/workspaces/voyver_website'
edit:
Seems I needed to run
npm install tailwindcss @tailwindcss/cli
since global tailwind does not work with the import directive
Is this still needed https://github.com/DioxusLabs/docsite/blob/84a6dfc386efab020def4f597d70126e689222fd/docs-src/0.6/src/cookbook/tailwind.md?plain=1#L35 or is it
v0.5.*specific? Related to Missing Dist Folder #435
- Is
tailwind.config.jsneeded at all forv4?
- I'm new to tailwind and Dioxus but I haven't seen the dist folder anywhere so presumably it's not necessary
- Again I'm unfamiliar with tailwind so not sure on that point, I just know the default tailwind setup with dx new doesn't work with v4, but replacing the input.css with that makes everything work
The dist folder was moved into the target folder at /target/dx/.... It shouldn't be required for tailwind classes unless you are dynamically generating tailwind class names which isn't recommended. If tailwind did include new classes based on the contents of the build output, dx would need to bundle again after the final classes file is created which would be slow