-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fixed size support #117
Comments
simonihmig
added a commit
that referenced
this issue
Feb 5, 2021
This accumulates a few (breaking) changes: * will add the CSS for responsive (fluid) image layout (the default) * when passing `@width` and/or `@height` arguments, it will opt into fixed layout (closes #117) * in fixed layout, it will pick the (fallback) `src` attribute based on the fixed width, pick `srcset` sources for that given width and pixel densities of `1x` and `2x`, and `width` and `height` with the appropriate fixed values (if one is missing, it will be computed based on the image's aspect ratio) * in responsive layout, `width` and `height` attributes are rendered even though the *actual* size is responsive, to let the browser know the correct vertical size (even before the image has been loaded), to reduce [Cumulative Layout Shift](https://web.dev/cls/) (Closes #88) * some (breaking) related changes in the service's API, removing `getImageBySize()`, renaming `getImageDataBySize()` to `getImageMetaBySize()` and introducing `getImageMetaByWidth()`
simonihmig
added a commit
that referenced
this issue
Feb 5, 2021
This accumulates a few (breaking) changes: * will add the CSS for responsive (fluid) image layout (the default) * when passing `@width` and/or `@height` arguments, it will opt into fixed layout (closes #117) * in fixed layout, it will pick the (fallback) `src` attribute based on the fixed width, pick `srcset` sources for that given width and pixel densities of `1x` and `2x`, and `width` and `height` with the appropriate fixed values (if one is missing, it will be computed based on the image's aspect ratio) * in responsive layout, `width` and `height` attributes are rendered even though the *actual* size is responsive, to let the browser know the correct vertical size (even before the image has been loaded), to reduce [Cumulative Layout Shift](https://web.dev/cls/) (Closes #88) * some (breaking) related changes in the service's API, removing `getImageBySize()`, renaming `getImageDataBySize()` to `getImageMetaBySize()` and introducing `getImageMetaByWidth()`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Support fluid and fixed size images, similar to https://www.gatsbyjs.com/plugins/gatsby-image/#two-types-of-responsive-images.
Ideas:
<ResponsiveImage @width={{500}} />
(setswidth
andheight
HTML attributes)The text was updated successfully, but these errors were encountered: