mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 03:49:34 +00:00
44 lines
No EOL
1.1 KiB
Text
44 lines
No EOL
1.1 KiB
Text
<script>
|
|
import { Theme } from "carbon-components-svelte";
|
|
import Preview from "../../components/Preview.svelte";
|
|
</script>
|
|
|
|
### Default
|
|
|
|
<FileSource src="/framed/Theme/Theme" />
|
|
|
|
### Persist locally
|
|
|
|
Set `persist` to `true` to persist the theme locally using the [Window.localStorage API](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage).
|
|
|
|
<FileSource src="/framed/Theme/ThemePersist" />
|
|
|
|
### Custom theme
|
|
|
|
Define keys and values in the `tokens` prop that override default Carbon theme tokens.
|
|
|
|
<FileSource src="/framed/Theme/ThemeTokens" />
|
|
|
|
### Theme toggle
|
|
|
|
Set `render` to `"toggle"` to render a toggle switch to control the theme.
|
|
|
|
<FileSource src="/framed/Theme/ThemeToggle" />
|
|
|
|
### Theme toggle (custom)
|
|
|
|
Customize the toggle using the `toggle` prop.
|
|
|
|
<FileSource src="/framed/Theme/ThemeToggleCustom" />
|
|
|
|
### Theme select
|
|
|
|
Set `render` to `"select"` to render a select dropdown to control the theme.
|
|
|
|
<FileSource src="/framed/Theme/ThemeSelect" />
|
|
|
|
### Theme select (custom)
|
|
|
|
Customize the select using the `select` prop.
|
|
|
|
<FileSource src="/framed/Theme/ThemeSelectCustom" /> |