Files
website-astro-stefanimhoff.de/src/components/Image.astro
Stefan Imhoff fc60b28ac1 feat: remove astro-imagetools
It's not worth the effort.
2024-04-04 15:00:55 +02:00

18 lines
586 B
Plaintext

---
import cx from 'classnames';
const { class: className, noMargin, src, ...props } = Astro.props;
const classes = cx(
'image-shadow mbe-10 mbs-0 [&_img]:!w-full [&_img]:!max-w-none [&_picture]:!w-full [&_picture]:!max-w-none',
{ 'mbe-0': noMargin },
className
);
const imageClasses =
'rounded-1 border-1 block h-auto w-full border-solid border-black/[0.1] bg-black/[0.1] shadow shadow-black/10 dark:border-white/[0.1] dark:opacity-[0.87] dark:shadow-white/10';
---
<div class={classes}>
<img class={imageClasses} decoding="async" loading="lazy" src={src} {...props} />
</div>