~james/core

core/docs/src/components/Diagram.astro -rw-r--r-- 373 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 15 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
// inlines a diagram svg so it can use the theme's css variables (see the
// .diagram rules in styles/diagrams.css). import the file with ?raw
interface Props {
  svg: string;
  caption?: string;
}

const { svg, caption } = Astro.props;
---

<figure class="diagram not-content">
  <Fragment set:html={svg} />
  {caption && <figcaption>{caption}</figcaption>}
</figure>