Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Latest commit

 

History

History
58 lines (37 loc) · 1.3 KB

deprecate_lazysizes.md

File metadata and controls

58 lines (37 loc) · 1.3 KB

Deprecate lazySizes (DeprecateLazysizes)

lazysizes is a common JavaScript library used to lazy load images, iframes and scripts.

Check Details

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">

Check Options

The default configuration for this check is the following:

DeprecateLazysizes:
  enabled: true

When Not To Use It

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.

Version

This check has been introduced in Theme Check 1.0.0.

Resources