Skip to content

Alter imgSrc to use srcset rather than just switching image source #1176

Open

Description

Proposal

What is the summary of the proposal?

Upgrade imgSrc to make use of the browser's own srcset functionality rather than just switching images.

What is the proposal?

The imgSrc API has a beautiful clarity about it and is great for implementation. However it doesn't seem to tap into the browser's own srcset functionality it means that while it serves the right image for the right screen size, it doesn't take account of pixel density.

This means that if an image if 400px across, imgSrc will load the same image whether it's displayed on a regular screen or a retina screen. If imgSrc instead generated srcset attributes, the browser would dynamically assess which the right image was given the current screen size.

Is there anything else we should know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    P5Low-priority issue that needs considerationhelp wantedThe team would appreciate a PR from the community to address this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions