satnaing / astro-paper

A minimal, accessible and SEO-friendly Astro blog theme
https://astro-paper.pages.dev/
MIT License
2.38k stars 500 forks source link

How can i set the logo_image svg header to be on the theme? #365

Open rodrigoantas opened 4 weeks ago

rodrigoantas commented 4 weeks ago

at the Header.astro we have the { LOGO_IMAGE.enable ? ( <img src={`/assets/${LOGO_IMAGE.svg ? "logo.svg" : "logo.png"}`} alt={SITE.title} width={LOGO_IMAGE.width} height={LOGO_IMAGE.height} class="header-icon" /> ) : ( SITE.title ) }

this img is referencing a svg. how can i set the color of the svg to be on the theme?

satnaing commented 2 weeks ago

I don't think there's any build-in way to update svg inside <img /> tag. So, what you can do is replace <img /> tag with your svg logo.

From this

<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}
      />
    ) : (
      SITE.title
    )
  } 
</a>

To this

<a href="/" class="logo whitespace-nowrap">
  <svg 
    class="fill-skin-base" 
    // others
  />
</a>