Skip to content

Commit

Permalink
chore: linting (#1885)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorw authored Jan 11, 2024
1 parent 6aa0ef6 commit 3bd943d
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions docs/src/pages/framed/_reset.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 3bd943d

Please sign in to comment.