mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
fix(theme): remove invalid themes
prop from markup (#2127)
This commit is contained in:
parent
e85d7efc5e
commit
5987b61a55
2 changed files with 25 additions and 5 deletions
|
@ -100,16 +100,18 @@
|
|||
{/if}
|
||||
|
||||
{#if render === "toggle"}
|
||||
{@const { themes: toggleThemes, ...toggleProps } = toggle}
|
||||
<Toggle
|
||||
{...toggle}
|
||||
toggled={theme === toggle.themes[1]}
|
||||
{...toggleProps}
|
||||
toggled={theme === toggleThemes[1]}
|
||||
on:toggle={({ detail }) => {
|
||||
theme = detail.toggled ? toggle.themes[1] : toggle.themes[0];
|
||||
theme = detail.toggled ? toggleThemes[1] : toggleThemes[0];
|
||||
}}
|
||||
/>
|
||||
{:else if render === "select"}
|
||||
<Select {...select} bind:selected={theme}>
|
||||
{#each select.themes as theme (theme)}
|
||||
{@const { themes: selectThemes, ...selectProps } = select}
|
||||
<Select {...selectProps} bind:selected={theme}>
|
||||
{#each selectThemes as theme (theme)}
|
||||
<SelectItem value={theme} text={themes[theme]} />
|
||||
{/each}
|
||||
</Select>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue