-
Notifications
You must be signed in to change notification settings - Fork 28
update tailwind configuration to adequate to v4 #68
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
Conversation
| @tailwind base; | ||
| @tailwind components; | ||
| @tailwind utilities; No newline at end of file | ||
| @import "tailwindcss"; No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the documentation, it's possible to add @config "tailwind.config.js"; to the input.css file, but why remove it afterward?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is supported for backward compatibility. For that reason, I think that it is not expected that new projects use js config files.
|
Thanks for working on this! This mostly looks good. When you install tailwind css with npm ( |
|
Added the nome modules to gitignore. |
|
Were you aware that tailwindcss cli does not need a dependency on npm? You can get a prebuilt tailwindcss cli binary for your platform. Then simply run it |
|
Hi, a little late to the conversation, was just reading through Tailwind docs and the Upgrade Guide suggests sticking with V3 if you have a requirement to support older versions of browsers, since V4 is for relatively new browser versions. This is usually relevant in many enterprises where Sec Ops are slow to change or even reluctant to upgrade software, so it occurred to me that it could be important to support multiple versions of Tailwind. Given that there are no Rust changes in this PR, is there a way to handle multiple versions of Tailwind efficiently in this context? Curious to hear your thoughts on whether this is feasible and how it could be approached. |
In my opinion, it is. Version 3 was already being supported. It is only necessary to add more options to the template. > Do you want to use Tailwing CSS?
yes
> What version (default: v4)?
v4
v3I don't know about older versions, though (v2, v1). |
I will test this approach. To me, it sounds better. |
|
On Mac you can you use https://formulae.brew.sh/formula/tailwindcss#default Though I haven't used it, https://winget.ragerworks.com/package/TailwindLabs.TailwindCSS |
|
We are shipping inline support for the non npm tailwind CLI in 0.7! https://x.com/dioxuslabs/status/1920270420466675848 It hasn't been generating package.json for me. |
This comment is seriously underrated. I recently learned this the hard way after building and testing a ~200k LOC frontend app, everything broke on older versions of Safari and other browsers on macOS. I had to rewrite everything and revert back to Tailwind v3. To avoid browser compatibility issues, I recommend pinning Tailwind to v3 for now. |
I have observed the same behavior using the binary cli for tailwind. Though you do need node.js and a {
"devDependencies": {
"daisyui": "^5.0.35"
}
}* worth noting with the binary version of tailwind, you only need the plugins referenced in your |
|
Hey! I had a hard time resolving some git issues since I just made a new v0.7 branch, but I included your changes and tagged you as a co-author I'm going to just pin v3 for the 0.6 template and we'll make v4 the default in 0.7 |
|
as tailwind v4 is now the upstream default, this results in a degraded experience in
Following these instructions leads to a semi broken tailwind setup, as the scaffolding ( maybe point to https://v3.tailwindcss.com/docs/installation instead? (and point out that v4 is not supported out of the box) Update: made a PR against Dioxus v0.6 |
see DioxusLabs#68 (comment) for further discussion

This PR solves the bug described in the issue 4013 of the dioxus repository. Basically, the template used when tailwind css is added to the project directs the user to install the latest version of the tailwind css (v4)
As stated by LeWimbes, the current configuration for tailwind works well with tailwind v3, but not v4.
Changes made
All the changes were made for the JumpStart and BareBones subtemplates.
tailwind.config.jsand their references fromconditional-files.rhaifile: https://tailwindcss.com/docs/upgrade-guide#using-a-javascript-config-fileTests
The changes were tested for JumpStart/desktop and BareBones/web, with some simple tailwing configurations.