astro-paper icon indicating copy to clipboard operation
astro-paper copied to clipboard

SVG logo doesn't inherit style

Open djacu opened this issue 9 months ago • 0 comments

AsterPaper version: 3.0.0

I have an SVG logo file with the stroke attribute set as such, stroke="currentColor". Unfortunately, the SVG doesn't inherit the currentColor` value unless I inline the SVG as shown below.

       <a href="/" class="logo whitespace-nowrap">
         {
           LOGO_IMAGE.enable ? (
-            <img
-              src={`/assets/${LOGO_IMAGE.svg ? "logo.svg" : "logo.png"}`}
-              alt={SITE.title}
-              width={LOGO_IMAGE.width}
-              height={LOGO_IMAGE.height}
-            />
+            LOGO_IMAGE.svg ? (
+              <svg xmlns="http://www.w3.org/2000/svg"
+                class="icon icon-tabler icon-tabler-source-code"
+                width="24"
+                height="24"
+                viewBox="0 0 24 24"
+                stroke-width="2"
+                stroke="currentColor"
+                fill="none"
+                stroke-linecap="round"
+                stroke-linejoin="round"
+              >
+                <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
+                <path d="M14.5 4h2.5a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-5" />
+                <path d="M6 5l-2 2l2 2" />
+                <path d="M10 9l2 -2l-2 -2" />
+              </svg>
+            ) : (
+              <img
+                src={logoPNG}
+                alt="djacu's logo"
+                width={LOGO_IMAGE.width}
+                height={LOGO_IMAGE.height}
+              />
+            )
           ) : (
             SITE.title
           )

djacu avatar Nov 14 '23 04:11 djacu