diff --git a/src/components/Header.svelte b/src/components/Header.svelte index d760810..1955620 100644 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -45,7 +45,8 @@ dropdownOpen = false; } - $: currentLabel = (collections.find(c => c.name === collection)?.label || "Logo Gallery").replace(/s$/, ""); + $: currentCollectionObj = collections.find(c => c.name === collection); + $: currentLabel = (currentCollectionObj?.title || currentCollectionObj?.label || "Logo Gallery").replace(/s$/, "");
@@ -55,7 +56,7 @@ Logo Gallery icon {#if dropdownOpen} {/if} @@ -107,6 +108,7 @@ {getTagObj} {compactMode} {setCompactMode} + collection={currentCollectionObj} /> `; + svgSource = svgHtml; + return; + } + let text = await res.text(); + if (!color) { + // No user-selected color, add currentColor to ensure theme colors are applied + const parser = new DOMParser(); + const doc = parser.parseFromString(text, "image/svg+xml"); + const svg = doc.documentElement; + + // Set currentColor on SVG element if no fill is specified + if (!svg.hasAttribute("fill")) { + svg.setAttribute("fill", "currentColor"); + } + + svgHtml = doc.documentElement.outerHTML; + return; + } + // Parse and update color only if user selected const parser = new DOMParser(); const doc = parser.parseFromString(text, "image/svg+xml"); - const svg = doc.documentElement; - - // Set currentColor on SVG element if no fill is specified - if (!svg.hasAttribute("fill")) { - svg.setAttribute("fill", "currentColor"); - } - - svgHtml = doc.documentElement.outerHTML; - return; - } - // Parse and update color only if user selected - const parser = new DOMParser(); - const doc = parser.parseFromString(text, "image/svg+xml"); - // 1. Parse