[gatsby-remark-copy-linked-files] Adding support for <source> #28497
Replies: 3 comments
-
Not sure if this deserves a separate issue, but I also just noticed that while the pixel density srcset works with Gatsby by default, it isn’t handled by this plugin. The following JSX is correctly processed: <img
srcSet={`${image} 1x, ${image2x} 2x, ${image3x} 3x`}
src={image}
/> but the HTML/markdown variant isn’t handled by <img
srcset="image.png 1x, image2x.png 2x, image3x.png 3x"
src=“image.png"
/> Interestingly, the |
Beta Was this translation helpful? Give feedback.
-
These would be great to fix! Would you be interested in adding a PR? |
Beta Was this translation helpful? Give feedback.
-
I’m gonna try to give it a shot! That said, I’m not really, uh, good, at JS, so I wouldn’t rate my odds high |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The way to set up dark mode images using pure HTML is using a combination of the
<picture>
and<source>
tags, like so (via CSS Tricks):As far as I can tell, this is the only pure HTML (and thus compatible with RSS, reader mode, etc.) way to deliver dark mode images, as well as other responsive images generic over any other media queries. Currently (as of v2.6.0),
gatsby-remark-copy-linked-files
ignores the source tag, copying over only theimg src
, and the resulting HTML looks like this:It would be nice to have support for
<source>
tags added to the package to enable this use case.Beta Was this translation helpful? Give feedback.
All reactions