Images as figures

This commit is contained in:
Jade Ellis
2024-07-16 20:43:43 +01:00
parent 7b3b00cd66
commit 1930ff408d
4 changed files with 31 additions and 7 deletions
@@ -1,8 +1,31 @@
<script>
export let src;
export let alt;
let className = ""
export { className as class };
// console.log(src)
// import _PastedImage20240716123726Png from "./Pasted%20image%2020240716123726.png?meta";
</script>
</script>
<img src={src} alt={alt}/>
<figure class={className}>
<img {src} {alt} />
{#if alt}
<figcaption>{alt}</figcaption>
{/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>