mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 19:01:05 +00:00
feat(theme): add Theme (#741)
* feat(theme): add Theme * fix(theme): fix broken type test * docs(theme): add examples * docs(theme): add description, update carbon theme link [ci skip] * docs: pre-wrap type code snippet [ci skip]
This commit is contained in:
parent
18c6f03224
commit
fac78ee4aa
18 changed files with 475 additions and 4 deletions
24
tests/Theme.test.svelte
Normal file
24
tests/Theme.test.svelte
Normal file
|
@ -0,0 +1,24 @@
|
|||
<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"
|
||||
toggle="{{
|
||||
themes: ['g10', 'g90'],
|
||||
labelA: '',
|
||||
labelB: '',
|
||||
}}"
|
||||
select="{{
|
||||
themes: ['g10', 'g90'],
|
||||
labelText: '',
|
||||
}}"
|
||||
/>
|
Loading…
Add table
Add a link
Reference in a new issue