summaryrefslogtreecommitdiff
path: root/www/src/components/Shell.astro
diff options
context:
space:
mode:
Diffstat (limited to 'www/src/components/Shell.astro')
-rw-r--r--www/src/components/Shell.astro28
1 files changed, 15 insertions, 13 deletions
diff --git a/www/src/components/Shell.astro b/www/src/components/Shell.astro
index 3147ba886..09d4e0aeb 100644
--- a/www/src/components/Shell.astro
+++ b/www/src/components/Shell.astro
@@ -1,9 +1,10 @@
---
export interface Props {
- code: string;
+ code: string;
}
const { code } = Astro.props;
---
+
<pre><code>{String(code).trim().split('\n').map(
line => <span class="line">{
line.startsWith('#') ? <span class="comment">{line}</span> : line
@@ -11,16 +12,17 @@ const { code } = Astro.props;
}</code></pre>
<style>
- pre, code {
- white-space: pre;
- }
- .comment {
- color: var(--color-gray-400);
- }
- .line {
- display: block;
- }
- .line:empty::after {
- content: " ";
- }
+ pre,
+ code {
+ white-space: pre;
+ }
+ .comment {
+ color: var(--color-gray-400);
+ }
+ .line {
+ display: block;
+ }
+ .line:empty::after {
+ content: ' ';
+ }
</style>