carbon-components-svelte/tests/GlobalTheme.test.svelte
Gregor Wassmann c0ff8ff76a chore: Move Theme to GlobalTheme
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.
2023-03-26 13:40:55 +02:00

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: '',
}}"
/>