2021-06-11 23:15:40 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
2021-06-12 00:18:50 +02:00
|
|
|
<script lang="ts">
|
|
|
|
import { onMount, createEventDispatcher } from "svelte";
|
|
|
|
|
2021-06-12 00:38:56 +02:00
|
|
|
let className = "";
|
|
|
|
export { className as class };
|
|
|
|
|
2021-06-12 00:18:50 +02:00
|
|
|
const dispatch = createEventDispatcher();
|
|
|
|
|
|
|
|
let spanRef: HTMLSpanElement;
|
|
|
|
|
|
|
|
onMount(() => {
|
|
|
|
dispatch("mount", { span: spanRef });
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2021-06-12 00:38:56 +02:00
|
|
|
<span bind:this={spanRef} class={`badge ${className}`} on:click>
|
2021-06-11 23:15:40 +02:00
|
|
|
<slot />
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.badge {
|
|
|
|
color: inherit;
|
|
|
|
}
|
|
|
|
|
|
|
|
span :global(svg) {
|
|
|
|
vertical-align: -0.125rem;
|
|
|
|
opacity: 0.3;
|
|
|
|
}
|
|
|
|
</style>
|