DeprecateLazysizes
Discourages use of the lazysizes JavaScript library for lazy loading images, iframes, and scripts.
You should avoid using third-party libraries over native browser features to avoid large JavaScript bundle sizes and slow load times. Learn more about theme performance.
This check identifies uses of the lazyload
class, data-srcset
and data-sizes
attributes, and data-sizes="auto"
.
Anchor to ExamplesExamples
The following examples contain code snippets that either fail or pass this check.
Anchor to ✗ Fail✗ Fail
The following example includes a lazyload
class:
The following example includes a lazyload
class, a data-srcset
attribute, a data-sizes
attribute, and data-sizes="auto"
:
Anchor to ✓ Pass✓ Pass
The following example uses the native loading
attribute instead of the lazysizes library:
Anchor to Disabling this checkDisabling this check
You should disable this check only if you want to support lazy loading of images in browsers that don't support the loading="lazy"
attribute.