{#if colorConfig && colorConfig.length} {@const themeContents = Object.entries(THEMES) .map( ([theme, prefix]) => ` ${prefix} [data-chart=${id}] { ${colorConfig .map(([key, itemConfig]) => { const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color; return color ? ` --color-${key}: ${color};` : null; }) .join("\n")} } ` ) .join("\n")} {#key id} {@html `${styleOpen} ${themeContents} ${styleClose}`} {/key} {/if}