Skip to content

WebP images 1.0.4: WebP sources inside existing <picture> elements

Choose a tag to compare

@effisk effisk released this 18 Nov 16:44
· 1 commit to main since this release
  • Existing <picture> elements (for example a theme's art-directed lead image with a mobile <source>) now get WebP too. In picture mode, a WebP <source> is added before each JPEG/PNG <source>, with the same media and sizes, and another one before the <img>. In replace mode their srcsets point to the WebP files.
  • A <picture> that already has a WebP <source> is left as it is. class="no-webp" or data-no-webp on the <picture> or its <img> also leaves it alone.