mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +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
|
@ -35,12 +35,14 @@
|
|||
{...$$restProps}
|
||||
on:click
|
||||
>
|
||||
{#if icon}
|
||||
{#if $$slots.icon || icon}
|
||||
<div
|
||||
class:bx--side-nav__icon="{true}"
|
||||
class:bx--side-nav__icon--small="{true}"
|
||||
>
|
||||
<svelte:component this="{icon}" />
|
||||
<slot name="icon">
|
||||
<svelte:component this="{icon}" />
|
||||
</slot>
|
||||
</div>
|
||||
{/if}
|
||||
<span class:bx--side-nav__link-text="{true}">{text}</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue