Change icons globally

Thank you! I also found Replace Discourse’s default SVG icons with custom icons in a theme

I ended up embedding the SVG sprite directly into the Header file, as uploading it and naming it as that article says to do did not work for me (could be operator error, of course).

So my Header is:

<svg width="0" height="0" class="hidden" style="display: none;">
    <symbol id="myicon-search" ..... </symbol>  
    <!-- all of my symbols here... -->
</svg>
<script type="text/discourse-plugin" version="0.8">
    api.replaceIcon('search', 'myicon-search'); 
</script>

And that is easy to manage.

I use the SVG sprite generator at https://svgsprit.es to make sure the format is correct.

2 Likes