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

Enable lazy loading for URLs on use href #927

Open
lfre opened this issue Dec 7, 2023 · 1 comment
Open

Enable lazy loading for URLs on use href #927

lfre opened this issue Dec 7, 2023 · 1 comment

Comments

@lfre
Copy link

lfre commented Dec 7, 2023

https://svgwg.org/svg2-draft/struct.html#UseElement

The loading attribute enables lazy loading for images and iframes. Likewise, the <use> tag could use this functionality to enable deferring the loading of SVGs as a URL. E.g:

<svg>
	<use href="/path/to/my.svg" loading="lazy" />
</svg>

What solutions exist today?

Like polyfills for lazy-loading, an Intersection Observer mechanism can swap a data-href attribute to href when approaching in view.

@Malvoz
Copy link

Malvoz commented Feb 18, 2024

Relatedly there's a request to support loading on <image> in #817.

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

No branches or pull requests

2 participants