summaryrefslogtreecommitdiff
path: root/www/src/components/Shell.astro
blob: d2738329ad1fa39ca7cd8071052c8036045e4665 (plain) (blame)
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
---
export interface Props {
  code: string;
}
const { code } = Astro.props;
---

<pre><code>{code.trim().split('\n').map(ln => <span class="line">
{ln.startsWith('#') ? <span class="comment">{ln}</span> : ln}
</span>)}</code></pre>

<style>
  pre, code {
    white-space: pre;
  }
  .comment {
    color: var(--color-gray-400);
  }
  .line {
    display: block;
  }
  .line:empty::after {
    content: " ";
  }
</style>