mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 11:59:34 +00:00
feat(theme): add Theme
This commit is contained in:
parent
18c6f03224
commit
3e7bae10ef
17 changed files with 357 additions and 3 deletions
21
tests/Theme.test.svelte
Normal file
21
tests/Theme.test.svelte
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<script lang="ts">
|
||||
import { Theme } from "../types";
|
||||
import { CarbonTheme } from "../types/Theme/Theme";
|
||||
|
||||
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"
|
||||
renderToggle="{{
|
||||
themes: ['g10', 'g90'],
|
||||
labelA: '',
|
||||
labelB: '',
|
||||
hideLabel: true,
|
||||
}}"
|
||||
/>
|
||||
Loading…
Add table
Add a link
Reference in a new issue