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

Preload option has no effect on CSS assets #3339

Closed
ochrons opened this issue Dec 11, 2024 · 0 comments · Fixed by #3531
Closed

Preload option has no effect on CSS assets #3339

ochrons opened this issue Dec 11, 2024 · 0 comments · Fixed by #3531
Assignees
Labels
bug Something isn't working cli Related to the dioxus-cli program manganis Related to the manganis crate

Comments

@ochrons
Copy link

ochrons commented Dec 11, 2024

Problem

Using with_preload on CSS assets has no effect since the rel attribute is set to stylesheet instead of preload. For example

const TAILWIND_CSS: Asset = asset!("/public/tailwind.css", CssAssetOptions::new().with_preload(true))

generates

<link rel="stylesheet" href="/assets/tailwind-627b9919aa94f0b5.css" type="text/css"/>

Steps To Reproduce

Steps to reproduce the behavior:

  • Use CssAssetOptions::new().with_preload(true) on a CSS asset
  • Check the generated HTML

Expected behavior

This describes how to get this working https://stackoverflow.com/questions/61889044/how-to-use-both-rel-preload-and-rel-stylesheet-for-the-same-tag

@ealmloff ealmloff added bug Something isn't working cli Related to the dioxus-cli program manganis Related to the manganis crate labels Dec 11, 2024
@ealmloff ealmloff self-assigned this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Related to the dioxus-cli program manganis Related to the manganis crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants