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

LinkPropsBuilder should have onload event attribute #3758

Open
emilbonnek opened this issue Feb 17, 2025 · 0 comments
Open

LinkPropsBuilder should have onload event attribute #3758

emilbonnek opened this issue Feb 17, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@emilbonnek
Copy link

Feature Request

Basically just the title. document::Link should probably have an onload event attribute we can use, similar to how buttons have an onclick etc.

I came across this when trying to use Shoelace in my Dioxus project.

Their section on setting up light and dark mode has this markup:

<link
  rel="stylesheet"
  media="(prefers-color-scheme:dark)"
  href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/themes/dark.css"
  onload="document.documentElement.classList.add('sl-theme-dark');"
/>

I am aware of the workarounds I can use, but I think it should be as straightforward as possible to translate simple things like this into Dioxus code.

@emilbonnek emilbonnek added the enhancement New feature or request label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant