You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling medium. Picturefill.js will never select the larger src, even when the -box growns beyond it. A difference can be seen in the measuring
in the . But in a sense (i guess) also has to do with the 'hardcoded' width= and height= in the tag.
Context: I have a page that renders the images at 100% width of it's container via CSS. The container is 100% of the viewport . At 1080px a media-query kicks in setting the container at 1080px.
Sizes of image sources are: medium max 720px, large max 1080px
The text was updated successfully, but these errors were encountered:
This sounds like the behavior I designed. The sizes attribute is used to choose the image size for output. The default sizes for your medium image should be (max-width: 720px) 100vw, 720px. This tells the browser to use the image size that best matches the browser width up to 720px, and above that point to use the image that best matches a width of 720px. More simply, "If there is room for this image, show this image, if not, show a size that fits." I assumed that this would be the most sought after behavior, and I think it is a useful default.
If I understand your case correctly, you want the image to always be as large as it can be without exceeding the width of the browser window. We can do this a few different ways.
We can register a new sizes attribute that matches our desired behavior, for the desired image sizes.
There is a difference in calling:
When calling
medium
. Picturefill.js will never select the larger src, even when the -box growns beyond it. A difference can be seen in the measuringContext:
I have a page that renders the images at 100% width of it's container via CSS. The container is 100% of the viewport . At 1080px a media-query kicks in setting the container at 1080px.
Sizes of image sources are: medium max 720px, large max 1080px
The text was updated successfully, but these errors were encountered: