gatsby-plugin-sanity-image
gatsby-plugin-sanity-image copied to clipboard
Would it be possible to pass multiple image sources?
I was wondering if it was possible to pass through multiple image sources so that, for example, we're able to use different images at different media sizes? And the output would be 0 or more source elements and a default img element, wrapped by a picture element
You can do this today:
<picture>
<SanityImage as="source" {…otherProps} />
<SanityImage {...otherProps />
</picture>
This does result in a few extraneous attributes on the source tags (e.g. alt) but they are ignored by the browser and don't interfere. I think this is a leaner approach for the library to take for now.