Files
continuwuity/packages/website/src/lib/htmlComponents/img.svelte
T

33 lines
652 B
Svelte
Raw Normal View History

2024-07-16 20:24:04 +01:00
<script>
export let src;
export let alt;
2024-07-16 20:53:09 +01:00
export let title;
2024-07-16 20:43:43 +01:00
let className = ""
export { className as class };
2024-07-16 20:24:04 +01:00
// console.log(src)
// import _PastedImage20240716123726Png from "./Pasted%20image%2020240716123726.png?meta";
2024-07-16 20:43:43 +01:00
</script>
2024-07-16 20:24:04 +01:00
2024-07-16 20:43:43 +01:00
<figure class={className}>
2024-07-16 20:53:09 +01:00
<img {src} {alt} {title} />
{#if title}
<figcaption>{title}</figcaption>
2024-07-16 20:43:43 +01:00
{/if}
</figure>
<style>
img {
max-height: 60vh;
display: block;
margin-inline: auto;
}
figure {
text-align: center;
}
figcaption {
font-size: 0.95em;
margin-block: calc(var(--spacing)/2);
}
</style>