File size: 889 Bytes
04ec17f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<script lang="ts">
import { setInitialMode } from "../mode.js";
import type { ThemeColors } from "../types.js";
let {
trueNonce = "",
initConfig,
themeColors,
}: {
trueNonce: string;
initConfig: Parameters<typeof setInitialMode>[0];
themeColors: ThemeColors;
} = $props();
</script>
<svelte:head>
{#if themeColors}
<!-- default to dark mode for to allow testing -->
<!-- this will be overwritten by FOUC prevention snippet below -->
<!-- but that snippet does not run in vitest -->
<meta name="theme-color" content={themeColors.dark} />
{/if}
<!-- eslint-disable-next-line svelte/no-at-html-tags, prefer-template, svelte/no-unused-svelte-ignore --><!-- svelte-ignore hydration_html_changed -->
{@html `<script${trueNonce ? ` nonce=${trueNonce}` : ""}>(` +
setInitialMode.toString() +
`)(` +
JSON.stringify(initConfig) +
`);</script>`}
</svelte:head>
|