Skip to content

fix: tailwind load problem on non root routes - #35

Merged
jkelleyrtp merged 1 commit into
DioxusLabs:mainfrom
ali77gh:fix-tailwind-other-route
Apr 25, 2024
Merged

jkelleyrtp merged 1 commit into
DioxusLabs:mainfrom
ali77gh:fix-tailwind-other-route

Conversation

@ali77gh

@ali77gh ali77gh commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

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