File size: 928 Bytes
e903a32 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
---
interface Props {
/** Unique ID for the reference */
id: string;
/** HTML caption for the reference */
caption: string;
}
const { id, caption } = Astro.props as Props;
---
<div class="reference-wrapper" id={id}>
<figure class="reference">
<div class="reference__content">
<slot />
</div>
<figcaption class="reference__caption" set:html={caption} />
</figure>
</div>
<style>
.reference-wrapper {
margin: var(--block-spacing-y) 0;
}
.reference {
margin: 0;
}
.reference__content {
/* Content can be anything */
}
.reference__caption {
text-align: left;
font-size: 0.9rem;
color: var(--muted-color);
margin-top: 6px;
background: var(--page-bg);
position: relative;
z-index: var(--z-elevated);
display: block;
width: 100%;
}
</style>
|