Files
housesof/apps/website/src/components/atoms/Badge.svelte
Félix Péault 6f8a619af2 refactor: migrate to Svelte 5
use runes ($props, $state, $derived, $effect, etc)
2024-08-02 17:50:16 +02:00

38 lines
759 B
Svelte

<style lang="scss">
.badge {
display: flex;
align-items: center;
justify-content: center;
min-height: 16px;
margin: 0 auto;
padding: 0 6px;
text-align: center;
background: $color-secondary-light;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 1px;
line-height: 1;
color: $color-primary-darker;
border-radius: 100vh;
// Small size
&--small {
font-size: rem(7px);
}
}
</style>
<script lang="ts">
let {
text,
size = 'small',
}: {
text: string
size?: string
} = $props()
</script>
<div class="badge badge--{size}">
<span>{text}</span>
</div>