We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61554e7 commit e07535eCopy full SHA for e07535e
packages/svelte-ux/src/lib/styles/theme.ts
@@ -22,7 +22,11 @@ export const colorNames = [
22
];
23
24
/** Return a script tag that will set the initial theme from localStorage. This allows setting
25
- * the theme before anything starts rendering, even when SSR is in use. */
+ * the theme before anything starts rendering, even when SSR is in use.
26
+ *
27
+ * This feels a bit weird compared to just placing the function directly in svelte:head,
28
+ * but it's the only way to inject the `darkThemes` array into the function.
29
+ **/
30
export function createHeadSnippet(darkThemes: string[]) {
31
function _applyInitialStyle(darkThemes) {
32
let theme = localStorage.getItem('theme');
0 commit comments