Fix webkit aspect ratio bug

This commit is contained in:
Andras Schmelczer 2022-09-28 14:29:42 +02:00
parent 22f636466e
commit 1cece74e0d
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E

View file

@ -17,15 +17,13 @@ export const Image = ({
class="image"
style="background-size: cover; background-image: url('${
image.placeholder
}'); aspect-ratio: ${image.width / image.height}"
}'); aspect-ratio: ${image.width / image.height};"
>
<img
${isEagerLoaded ? '' : 'loading="lazy"'}
srcset="${image.srcSet}"
${sizes ? `sizes="${sizes}"` : ''}
src="${image.src}"
width="${image.width}"
height="${image.height}"
alt="${alt}"
/>
</div>`;