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

Update tailwind.md #431

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update tailwind.md #431

wants to merge 1 commit into from

Conversation

leo030303
Copy link
Contributor

Fixed input.css file for tailwind version 4 see here DioxusLabs/dioxus#3286 (comment)

Fixed input.css file for tailwind version 4 see here DioxusLabs/dioxus#3286 (comment)
@mcmah309
Copy link

mcmah309 commented Feb 6, 2025

  1. Is this still needed

    or is it v0.5.* specific? Related to Missing Dist Folder #435

  2. Is tailwind.config.js needed at all for v4?

@mcmah309
Copy link

mcmah309 commented Feb 6, 2025

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

@leo030303
Copy link
Contributor Author

  1. Is this still needed


    or is it v0.5.* specific? Related to Missing Dist Folder #435

    1. Is tailwind.config.js needed at all for v4?
  1. I'm new to tailwind and Dioxus but I haven't seen the dist folder anywhere so presumably it's not necessary
  2. 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

@ealmloff
Copy link
Member

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

@mcmah309 mcmah309 mentioned this pull request Feb 20, 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