Spaces:
Running
Running
| --- | |
| interface Props { | |
| /** ID unique pour la référence */ | |
| id: string; | |
| /** Légende HTML pour la référence */ | |
| 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 { | |
| /* Le contenu peut être n'importe quoi */ | |
| } | |
| .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> | |