fix: tailwind load problem on non root routes #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I just started a web project with Dioxus. I ran
dx new
and started with the template. However, I encountered an issue when trying to use my CSS files in other routes than root.Problem
The CSS worked on root http://localhost:8080/ and found the Tailwind CSS on http://localhost:8080/tailwind.css.
However, the CSS didn't work on http://localhost:8080/tool/add_commas because it was trying to locate the Tailwind file at http://localhost:8080/tools/tailwind.css, and there was no
tailwind.css
in./assets/tool/tailwind.css
, which caused it to break.Solution
I managed to fix the problem by adding a
/
in Dioxus.toml before tailwind.css (and my own css file). So, I decided to create a pull request for this fix.More
I'm excited about contributing to Dioxus, my favorite web framework.
If there are any issues with my PR, please let me know.
Lastly, should I apply the same change to the Desktop and FullStack templates?
Thanks for your attention and feedback!