Problem/Motivation

Lazysizes JS library can't read `data-sizes` attribute from source tags, but rather only from img tag. This causes the library not to automatically set `sizes` attribute when using a picture tag.

Steps to reproduce

Set a responsive image style with multiple breakpoints with multiple image styles per breakpoint.

Proposed resolution

Force `sizes` attribute on img tag as well.

Remaining tasks

Patch the original Laszysizes JS library to recognize `sizes` attribute on source tags.

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#4 3578238.patch1.25 KBmafit25139
#3 3578238.patch1.24 KBmafit25139
#2 3578238.patch1.23 KBmafit25139

Issue fork lazy-3578238

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

    Comments

    mafit25139 created an issue. See original summary.

    mafit25139’s picture

    StatusFileSize
    new1.23 KB
    mafit25139’s picture

    StatusFileSize
    new1.24 KB
    mafit25139’s picture

    StatusFileSize
    new1.25 KB
    avpaderno’s picture

    Version: 4.0.2 » 4.0.x-dev
    Status: Active » Needs review