I thought that once I had an SVG logo, it would change colors. I was sort of right...and also wrong.

Take a look at the quark logo.html.twig file:

{% set logo = theme_var(mobile ? 'custom_logo_mobile' : 'custom_logo') %}
<a href="{{ home_url }}" class="navbar-brand mr-10">
{% if logo %}
  {% set logo_file = (logo|first).name %}
  <img src="{{ url('theme://images/logo/' ~ logo_file)  }}" alt="{{ site.name }}" />
{% else %}
  {% include('@images/grav-logo.svg') %}
{% endif %}

It turns out, if you set a custom logo via the yaml configuration file, the logo.html.twig file will put the SVG file inside an tag, redering the SVG color changing code useless. Some googling shows that several folks have run into this before. I opted to disable the custom logo and copy my images/logo/weber.svg to images/grav-logo.svg. This lets the default logo.html.twig pick it up as if it was the default grav logo. I was going to open an issue so that logo.html.twig could be smarter about including SVGs, but the quark Issue 54 comments led me to belive that would not get fixed/implemented.

Previous Post Next Post