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

fix: tailwind load problem on non root routes #35

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

ali77gh
Copy link
Contributor

@ali77gh ali77gh commented Apr 17, 2024

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!

@jkelleyrtp jkelleyrtp merged commit 35e2dce into DioxusLabs:main Apr 25, 2024
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.

2 participants