We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
data-sizes="auto"
<source>
1 parent 626801a commit fa7404dCopy full SHA for fa7404d
packages/core/src/lazyLoad.ts
@@ -27,6 +27,10 @@ export function lazyLoad<T extends HTMLImageElement>(
27
// Calculate the image's `sizes` attribute if `data-sizes="auto"` is set
28
updateSizesAttribute(image)
29
30
+ // Update `sizes` attribute for source elements inside a picture element
31
+ if (image.parentElement?.tagName.toLowerCase() === 'picture')
32
+ [...image.parentElement.getElementsByTagName('source')].forEach(updateSizesAttribute)
33
+
34
// Generate the blurry placeholder from a Blurhash or ThumbHash string if applicable
35
if (__ENABLE_HASH_DECODING__ && hash) {
36
const placeholder = createPlaceholderFromHash({
0 commit comments