a3-lazy-load icon indicating copy to clipboard operation
a3-lazy-load copied to clipboard

added dynamic svg placeholder

Open shakee93 opened this issue 5 years ago • 2 comments

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.

shakee93 avatar May 09 '20 02:05 shakee93

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

Note: Base64 encoding is not needed with SVG placeholders.

prathamesh-gharat avatar Jan 07 '21 13:01 prathamesh-gharat

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!

MythThrazz avatar May 16 '22 11:05 MythThrazz