mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
refactor(theme-picker): use two-way binding
This commit is contained in:
parent
1802d963ac
commit
45f3a8ca65
1 changed files with 2 additions and 11 deletions
|
@ -19,20 +19,11 @@
|
|||
|
||||
afterUpdate(() => {
|
||||
localStorage.setItem('theme', $theme);
|
||||
});
|
||||
|
||||
$: {
|
||||
document.documentElement.setAttribute('carbon-theme', $theme);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<Select
|
||||
{inline}
|
||||
labelText="Theme"
|
||||
selected={$theme}
|
||||
on:change={({ detail }) => {
|
||||
theme.set(detail);
|
||||
}}>
|
||||
<Select {inline} labelText="Theme" bind:selected={$theme}>
|
||||
<SelectItem value="white" text="White" />
|
||||
<SelectItem value="g10" text="Gray 10" />
|
||||
<SelectItem value="g90" text="Gray 90" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue