Script `src` not loading correctly in HTML head
When adding a script tag for the Tailwind CSS CDN in the head section of the HTML, the script is not loading correctly and the page appears empty. The code being used to add the script tag is:
head::Script { src: asset!("https://cdn.tailwindcss.com") }
// or
head::Script { src: "https://cdn.tailwindcss.com" }
However, both of these approaches result in the script not being loaded
Expected Behavior: The Tailwind CSS styles should be properly loaded and applied to the page when the script tag is added to the head section.
Actual Behavior: Indicating the script is not being loaded correctly.
Steps to reproduce the behavior:
cargo install --git https://github.com/dioxuslabs/dioxus dioxus-cli --locked
dx --version
dioxus 0.6.0-alpha.2 (3c699aa)
[dependencies]
dioxus = { git = "https://github.com/DioxusLabs/dioxus", features = ["web", "router"] }
dioxus-logger = "0.5.1"
Screenshots
Environment:
- Dioxus version: 0.6.0-alpha.2 (3c699aa)
- Rust version: rustc 1.80.1 (3f5fd8dd4 2024-08-06)
- OS info: Windows 11 Pro, 23H2, 22631.4037
- App platform:
web
Questionnaire
- [ ] I'm interested in fixing this myself but don't know where to start
- [ ] I would like to fix and I have a solution
- [ ] I don't have time to fix this right now, but maybe later
head::Link { href: "https://blah.css" }
this will work today - it looks like we just don't do script
Can you implement both types with a tag attribute and a body within it? Example on https://tailwindcss.com/docs/installation/play-cdn 2 Try customizing your config
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
clifford: '#da373d',
}
}
}
}
</script>