mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
feat: make icons slottable (#1186)
This commit is contained in:
parent
d9ee8cb2d9
commit
e23b121143
16 changed files with 139 additions and 46 deletions
|
@ -45,9 +45,14 @@
|
|||
on:mouseenter
|
||||
on:mouseleave
|
||||
>
|
||||
<slot />{#if !inline && icon}<div class:bx--link__icon="{true}">
|
||||
<svelte:component this="{icon}" />
|
||||
</div>{/if}
|
||||
<slot />
|
||||
{#if !inline && ($$slots.icon || icon)}
|
||||
<div class:bx--link__icon="{true}">
|
||||
<slot name="icon">
|
||||
<svelte:component this="{icon}" />
|
||||
</slot>
|
||||
</div>
|
||||
{/if}
|
||||
</p>
|
||||
{:else}
|
||||
<a
|
||||
|
@ -65,8 +70,14 @@
|
|||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
><slot />{#if !inline && icon}<div class:bx--link__icon="{true}">
|
||||
<svelte:component this="{icon}" />
|
||||
</div>{/if}</a
|
||||
>
|
||||
<slot />
|
||||
{#if !inline && ($$slots.icon || icon)}
|
||||
<div class:bx--link__icon="{true}">
|
||||
<slot name="icon">
|
||||
<svelte:component this="{icon}" />
|
||||
</slot>
|
||||
</div>
|
||||
{/if}
|
||||
</a>
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue