mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
style(docs): color-scheme
reflects theme (#1874)
This commit is contained in:
parent
fe0b0c2b18
commit
1600775968
4 changed files with 34 additions and 7 deletions
|
@ -80,7 +80,14 @@
|
|||
}
|
||||
}}" />
|
||||
|
||||
<Theme persist bind:theme="{$theme}">
|
||||
<Theme
|
||||
persist
|
||||
bind:theme="{$theme}"
|
||||
on:update="{(e) => {
|
||||
const theme = e.detail.theme;
|
||||
document.documentElement.style.setProperty("color-scheme", ["white", "g10"].includes(theme) ? "light" : "dark");
|
||||
}}"
|
||||
>
|
||||
<Header
|
||||
aria-label="Navigation"
|
||||
href="{$url('/')}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue