<svg class="d-none">
    <symbol id="icon-heart" viewBox="0 0 40 40">
        <path fill="currentColor" d="M3.1,13.7c0.1-1.3,0.4-2.6,1.1-3.8C5,8.3,6.2,7,7.7,6c1.7-1,3.5-1.4,5.5-1.2c2.9,0.3,4.9,1.9,6.5,4.1
  c0.3,0.4,0.5,0.8,0.8,1.2c0.4-0.7,0.8-1.3,1.2-1.9c1.5-1.8,3.2-3.1,5.6-3.4c2.5-0.4,4.9,0.2,6.9,1.8c2.8,2.3,3.9,5.3,3.8,8.8
  c-0.1,2.2-0.9,4.2-2.1,6c-1.6,2.4-3.6,4.4-5.7,6.2c-2.9,2.6-5.9,5.1-8.8,7.6c-0.5,0.4-1,0.5-1.5,0.1c-3.3-2.8-6.6-5.6-9.8-8.5
  c-1.5-1.4-3-2.8-4.2-4.5C3.9,19.8,2.9,16.8,3.1,13.7z"/>
    </symbol>
</svg>
<svg class="icon-heart">
  <use xlink:href="#icon-heart"/>
</svg>
.d-none{
  display: none;
}
.icon-heart{
  width: 40px;
  height: 40px;
  color: #ccc;
  stroke: #aaa;
  stroke-width: 2px;
}
.icon-heart:hover{
  color: red;
  stroke: blue;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.