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

Implement lazy loading with relative links to icons SVGs #165

Merged
merged 1 commit into from
Dec 25, 2021

Conversation

mondeja
Copy link
Member

@mondeja mondeja commented Dec 22, 2021

Fixes #161 and fixes #143

The implementation for lazy loading in #55 didn't taken into account that lazy loading is not supported by browsers if images are included as base64 data URLs.

This changes the loading by using icon SVG relative links. Now the page loads fast because icons are only loaded as they appear in the screen.

Before

lazy-loading-base64-bug

After

after-lazy-loading

@mondeja mondeja added the bug Something isn't working label Dec 22, 2021
@LitoMore
Copy link
Member

cc @jorgeamadosoria The #159 needs to be updated as well.

@jorgeamadosoria
Copy link
Contributor

Looks good to me.
I don't see a need for unit testing the loading of a file: it's just accessing an url in the filesystem, it's not really code. That strikes me as overkill.
Otherwise, fine. Merge it so I can replicate it on #159 as @LitoMore said.

@mondeja mondeja merged commit a2c2948 into simple-icons:master Dec 25, 2021
@mondeja mondeja deleted the fix-161-and-143 branch December 25, 2021 23:00
@mondeja mondeja mentioned this pull request Feb 4, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Your website is killing the browser Slow render while using mobile data.
3 participants