lazysizes is a common JavaScript library used to lazy load images, iframes and scripts.
This check is aimed at discouraging the use of the lazysizes JavaScript library
👎 Examples of incorrect code for this check:
<!-- Reports use of "data-srcset" and "data-sizes" attribute. Reports data-sizes="auto" -->
<img
alt="House by the lake"
data-sizes="auto"
data-srcset="small.jpg 500w,
medium.jpg 640w,
big.jpg 1024w"
data-src="medium.jpg"
class="lazyload"
/>
👍 Examples of correct code for this check:
<!-- Does not use lazySizes library. Instead uses native "loading" attribute -->
<img src="a.jpg" loading="lazy">
The default configuration for this check is the following:
DeprecateLazysizes:
enabled: true
You should disable this rule if you want to support lazy loading of images in older browser that don't support the loading="lazy" attribute yet.
This check has been introduced in Theme Check 1.0.0.