blob: d347deb0cecc124f0e98694b51e7f48bd9f2f633 (
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<script lang="ts">
export let inline: boolean = false;
export let svg: string;
export let onclick;
</script>
<div
role="button"
tabindex="0"
on:click={onclick}
on:keydown={onclick}>
<span class:inline={inline}>
{@html svg}
</span>
</div>
<span class:inline={inline}>
{@html svg}
</span>
<style lang="scss">
span {
& :global(svg) {
width: 1em;
height: 1em;
fill: currentColor;
}
&.inline :global(svg) { transform: translate(0, 0.125em); }
}
div {
background-color: green;
user-select: none;
padding: 1px 18px;
border-radius: 9999px;
display: flex;
align-items: center;
justify-content: center;
}
</style>
|