Open mynameisadamf opened 1 year ago
<Picture
width="100%"
{...props}>
<Source
src={data.src}
aspectRatio="4/5"
sizes="100vw"
media="(min-width: 30em)" />
<Image
src={data.src}
aspectRatio="2/3"
sizes="100vw"
media="(min-width: 45em)" />
<Image
src={data.src}
aspectRatio="1/1"
sizes="100vw" />
</Picture>
A DX similar to this would be ideal. We should also have crop="focal_point"
support (via MediaPresentation object); have connected with @richardmonette previously on this with some thoughts.
I'd also be curious to take the opportunity to look at a CSS-only blurhash; which @frehner proposed previously. This looked pretty interesting to me: https://joebell.co.uk/blog/loading-images-with-the-blur-down-technique.
Or at very least, provide an example for it.
Draft implementation of focal point: https://github.com/Shopify/hydrogen/pull/2139
Motivation
Right now we are pulling in 1 media asset for a product or collection across small/medium/large screens. This 1 asset with no focal point can lead to bad cropping.
See decapitated snowboarder![Image](https://user-images.githubusercontent.com/88168504/196822627-197f7dd1-605b-4833-8d60-ce8a536bf725.PNG)
Opportunity
Brainstorm features & functionality: