mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
The reason for this is that Theme is a new v11 component that allows for inline theming. That’s a different purpose than this component has. In the standard Carbon implementation a GlobalTheme is used that matches the purpose of what this Svelte component used to do. The idea is to stick to the same name as the standard implementation.
24 lines
486 B
Svelte
24 lines
486 B
Svelte
<script lang="ts">
|
|
import { Theme } from "../types";
|
|
import type { CarbonTheme } from "../types/Theme/Theme.svelte";
|
|
|
|
let theme: CarbonTheme = "g10";
|
|
</script>
|
|
|
|
<Theme
|
|
bind:theme
|
|
persist
|
|
persistKey="carbon-theme"
|
|
on:update="{(e) => console.log(e.detail.theme)}"
|
|
tokens="{{ 'button-primary': 'violet' }}"
|
|
render="toggle"
|
|
toggle="{{
|
|
themes: ['g10', 'g90'],
|
|
labelA: '',
|
|
labelB: '',
|
|
}}"
|
|
select="{{
|
|
themes: ['g10', 'g90'],
|
|
labelText: '',
|
|
}}"
|
|
/>
|