diff --git a/scripts/optimize-image-preprocessor.js b/scripts/optimize-image-preprocessor.js index d324124a..214963c3 100644 --- a/scripts/optimize-image-preprocessor.js +++ b/scripts/optimize-image-preprocessor.js @@ -20,13 +20,17 @@ const processMarkup = async ({ content, filename }) => { .filter(Boolean) .join(' '); + const dimensions = node.attributes.some(attr => attr.name === 'width' || attr.name === 'height') + ? '' + : `width={(${srcValue}).img.w} height={(${srcValue}).img.h}`; + const pictureHtml = ` {#if typeof ${srcValue} === 'object' && (${srcValue}).sources} {#each Object.entries((${srcValue}).sources) as [filetype, src]} {/each} - + {:else} {/if} diff --git a/src/app.css b/src/app.css index 2467138e..eda8c81f 100644 --- a/src/app.css +++ b/src/app.css @@ -238,6 +238,7 @@ section.dark + section.dark { img { max-width: 100%; + height: auto; } hr { diff --git a/src/routes/shop/comma-four/+page.svelte b/src/routes/shop/comma-four/+page.svelte index aaae75c4..a1587632 100644 --- a/src/routes/shop/comma-four/+page.svelte +++ b/src/routes/shop/comma-four/+page.svelte @@ -392,6 +392,7 @@ margin-bottom: 2rem; & img { + width: auto; max-height: 150px; }