chadtmiller.com/spaces-bookclub
Book club: a Svelte demo app for atproto spaces (@atproto/lex-space)
0
0
<script lang="ts">
import type { Snippet } from 'svelte'
import Icon, { type IconName } from './Icon.svelte'
let {
tone = 'neutral',
icon,
children,
}: {
tone?: 'neutral' | 'accent' | 'success'
icon?: IconName
children: Snippet
} = $props()
</script>
<span class="badge {tone}">
{#if icon}<Icon name={icon} size={12} />{/if}
{@render children()}
</span>
<style>
.badge {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: 0.125rem var(--space-2);
border-radius: var(--radius-full);
font-size: var(--text-xs);
font-weight: var(--weight-medium);
white-space: nowrap;
}
.neutral {
background: var(--color-surface-sunken);
color: var(--color-text-muted);
}
.accent {
background: var(--color-accent-soft);
color: var(--color-accent);
}
.success {
background: var(--color-success-soft);
color: var(--color-success);
}
</style>