Skip to content

Conversation

@shakee93
Copy link

@shakee93 shakee93 commented May 9, 2020

adds support to dynamic svg/base64 datauri placeholder instead of the image placeholder. only if there is width and height attribute present in the img tag. this helps eliminate the reflow the jitter we get while lazy loading (cls : https://web.dev/cls/).

this pull doesn't break the default behaviour. it uses the default _placeholder_url only works when

add_filter('a3_lazy_load_svg_placeholder', function () {
	return true;
});

above filter is set to true.

@prathamesh-gharat
Copy link

@shakee93 - Thanks, this is a much needed feature in A3 Lazy load.

Note: Base64 encoding is not needed with SVG placeholders.

@MythThrazz
Copy link

Amazing idea, just realized that we have a huge CLS issue because of the default placeholder.gif doesn't respect the aspect ratio of the images. Tried it and it worked like a charm!

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

Successfully merging this pull request may close these issues.

3 participants