feat: make icons slottable (#1186)

This commit is contained in:
metonym 2022-03-19 11:37:20 -07:00 committed by GitHub
commit e23b121143
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 139 additions and 46 deletions

View file

@ -120,9 +120,11 @@
on:mouseenter
on:mouseleave
>
{#if icon}
{#if $$slots.icon || icon}
<div class:bx--tag__custom-icon="{true}">
<svelte:component this="{icon}" />
<slot name="icon">
<svelte:component this="{icon}" />
</slot>
</div>
{/if}
<span>
@ -153,9 +155,11 @@
on:mouseenter
on:mouseleave
>
{#if icon}
{#if $$slots.icon || icon}
<div class:bx--tag__custom-icon="{true}">
<svelte:component this="{icon}" />
<slot name="icon">
<svelte:component this="{icon}" />
</slot>
</div>
{/if}
<span>