Skip to content

Commit

Permalink
chore: linting (carbon-design-system#1885)
Browse files Browse the repository at this point in the history
gregorw authored Jan 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 6aa0ef6 commit 3bd943d
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion docs/src/pages/_layout.svelte
Original file line number Diff line number Diff line change
@@ -85,7 +85,10 @@
bind:theme="{$theme}"
on:update="{(e) => {
const theme = e.detail.theme;
document.documentElement.style.setProperty("color-scheme", ["white", "g10"].includes(theme) ? "light" : "dark");
document.documentElement.style.setProperty(
'color-scheme',
['white', 'g10'].includes(theme) ? 'light' : 'dark'
);
}}"
>
<Header
9 changes: 6 additions & 3 deletions docs/src/pages/framed/_reset.svelte
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 3bd943d

Please sign in to comment.