Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[MASTER FEATURE] <amp-img> sizes="auto" for srcset #19513
I find making Responsive Images in amp-html actually harder than normal HTML (which should not be the case).
Take the following code examples:
The first example I am going to create a responsive image in normal html using the wonderful lazysizes library, see code example:
The above library does the hard work for you with the attribute
Taken from their Spec: "lazysizes supports setting the sizes attribute automatically, corresponding to the current size of your image - just set the value of data-sizes to auto."
I would love to see the feature in AMP-HTML so we can create the following code example: