chore: linting (#1885)

This commit is contained in:
Gregor Wassmann 2024-01-11 15:55:39 +01:00 committed by GitHub
commit 3bd943d12c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -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

View file

@ -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>