mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
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.
This commit is contained in:
parent
4c5d8cd1ed
commit
c0ff8ff76a
12 changed files with 9 additions and 9 deletions
24
tests/GlobalTheme.test.svelte
Normal file
24
tests/GlobalTheme.test.svelte
Normal file
|
@ -0,0 +1,24 @@
|
|||
<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: '',
|
||||
}}"
|
||||
/>
|
Loading…
Add table
Add a link
Reference in a new issue