mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(button): derive hasIconOnly from icon and slots
Instead of explicitly defining hasIconOnly, its value can be inferred from a falsy icon prop and an empty slot.
This commit is contained in:
parent
475acd6a5e
commit
2d3edce3ca
2 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,6 @@
|
|||
export let type = 'button';
|
||||
export let icon = undefined;
|
||||
export let iconDescription = undefined;
|
||||
export let hasIconOnly = false;
|
||||
export let tooltipPosition = undefined;
|
||||
export let tooltipAlignment = undefined;
|
||||
export let style = undefined;
|
||||
|
@ -19,6 +18,7 @@
|
|||
import { getContext } from 'svelte';
|
||||
import { cx } from '../../lib';
|
||||
|
||||
const hasIconOnly = !!icon && !$$props.$$slots;
|
||||
const ctx = getContext('ComposedModal');
|
||||
|
||||
let buttonRef = undefined;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue