Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG logo doesn't inherit style #169

Open
djacu opened this issue Nov 14, 2023 · 0 comments
Open

SVG logo doesn't inherit style #169

djacu opened this issue Nov 14, 2023 · 0 comments

Comments

@djacu
Copy link

djacu commented Nov 14, 2023

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
           )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant