mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
chore: linting (#1885)
This commit is contained in:
parent
6aa0ef61ad
commit
3bd943d12c
2 changed files with 10 additions and 4 deletions
|
@ -15,9 +15,12 @@
|
|||
// NOTE: we *do not* want to persist the theme as this can
|
||||
// conflict with how the iframe is displayed in the docs.
|
||||
// Instead, we want the theme to be overridden in the standalone page.
|
||||
if ([ "white", "g10", "g80", "g90", "g100" ].includes(current_theme)) {
|
||||
document.documentElement.setAttribute("theme", current_theme)
|
||||
document.documentElement.style.setProperty("color-scheme", ["white", "g10"].includes(current_theme) ? "light" : "dark");
|
||||
if (["white", "g10", "g80", "g90", "g100"].includes(current_theme)) {
|
||||
document.documentElement.setAttribute("theme", current_theme);
|
||||
document.documentElement.style.setProperty(
|
||||
"color-scheme",
|
||||
["white", "g10"].includes(current_theme) ? "light" : "dark"
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue