tabler / tabler-icons

A set of over 5700 free MIT-licensed high-quality SVG icons for you to use in your web projects.
https://tabler.io/icons
MIT License
18.35k stars 921 forks source link

Filled icons from sprite are drawn non-filled #1213

Open bobrof opened 3 months ago

bobrof commented 3 months ago

Description

I suppose this behaviour is due to the filled icons are imported with attributes <symbol id="tabler-filled-bell" fill="none" stroke="currentColor" .... One possible workaround could possibly be changing fill attribute to currentColor for filled icons

Package

Version

3.13

Browser

Operating system

Steps to reproduce

  1. Import tabler icons sprite
  2. Use filled-bell icon: <use xlink:href="path/to/tabler-sprite.svg#tabler-filled-bell" />
  3. Non filled icon is drawn

Svg extraction from latest 3.13 version with example:

<svg xmlns="http://www.w3.org/2000/svg"><defs>
  <symbol id="tabler-filled-bell" viewBox="0 0 24 24" fill="currentColor" stroke="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M14.235 19c.865 0 1.322 1.024 .745 1.668a3.992 3.992 0 0 1 -2.98 1.332a3.992 3.992 0 0 1 -2.98 -1.332c-.552 -.616 -.158 -1.579 .634 -1.661l.11 -.006h4.471z" />
  <path d="M12 2c1.358 0 2.506 .903 2.875 2.141l.046 .171l.008 .043a8.013 8.013 0 0 1 4.024 6.069l.028 .287l.019 .289v2.931l.021 .136a3 3 0 0 0 1.143 1.847l.167 .117l.162 .099c.86 .487 .56 1.766 -.377 1.864l-.116 .006h-16c-1.028 0 -1.387 -1.364 -.493 -1.87a3 3 0 0 0 1.472 -2.063l.021 -.143l.001 -2.97a8 8 0 0 1 3.821 -6.454l.248 -.146l.01 -.043a3.003 3.003 0 0 1 2.562 -2.29l.182 -.017l.176 -.004z" />
  </symbol>
</defs></svg>
<svg class="w-10 h-10 text-green-500">
  <!-- Icon is drawn non-filled  -->
  <use href="#tabler-filled-bell" fill="blue" stroke="none"/>
</svg>

Checklist