Fix image sizing
This commit is contained in:
parent
33051841f5
commit
babda52779
3 changed files with 6 additions and 4 deletions
|
|
@ -23,6 +23,7 @@ export class Header extends PageElement {
|
|||
photo: Image({
|
||||
image,
|
||||
alt: imageAltText,
|
||||
sizes: '(max-width: 924px) 125px, 190px',
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
|
|
|||
|
|
@ -7,11 +7,13 @@ export const Image = ({
|
|||
alt,
|
||||
container = false,
|
||||
isIgnoredByImageViewer = false,
|
||||
sizes = null,
|
||||
}: {
|
||||
image: ResponsiveImage;
|
||||
alt: string;
|
||||
container?: boolean;
|
||||
isIgnoredByImageViewer?: boolean;
|
||||
sizes?: string | null;
|
||||
}): html => `
|
||||
${
|
||||
container
|
||||
|
|
@ -28,9 +30,8 @@ export const Image = ({
|
|||
<img
|
||||
${isIgnoredByImageViewer ? 'image-viewer-ignore' : ''}
|
||||
loading="lazy"
|
||||
width="${image.width}"
|
||||
height="${image.height}"
|
||||
srcset="${image.srcSet}"
|
||||
${sizes ? `sizes="${sizes}"` : ''}
|
||||
src="${image.src}"
|
||||
alt="${alt}"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue