mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +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
|
@ -34,10 +34,11 @@
|
|||
$: multiple = api_components.length > 1;
|
||||
|
||||
onMount(() => {
|
||||
const currentTheme = window.location.search.split("?theme=")[1];
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
const current_theme = searchParams.get("theme");
|
||||
|
||||
if (["white", "g10", "g80", "g90", "g100"].includes(currentTheme)) {
|
||||
theme.set(currentTheme);
|
||||
if (["white", "g10", "g80", "g90", "g100"].includes(current_theme)) {
|
||||
theme.set(current_theme);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue