svg-icon icon indicating copy to clipboard operation
svg-icon copied to clipboard

resolve <defs>

Open leungwensen opened this issue 8 years ago • 2 comments

complex SVG icons using <defs> (for reusing paths, enable gradients, etc.) can not be rendered properly if simply replace <svg> into <symbol>. <defs> should be placed just under root level.

leungwensen avatar Aug 05 '16 08:08 leungwensen

conclusion:

  • [x] removing style="display:none;" in <svg> tag can solve this for webkit-based browsers;
  • [ ] extracting gradients should fix this problem for IE and Firefox.

leungwensen avatar Aug 05 '16 09:08 leungwensen

Besides that fact that you have a bug when not using <defs>, it is also not compliant to the SVG 1.1 spec, which states the use of <defs>.

Also see #14.

Tklaversma avatar Aug 09 '16 06:08 Tklaversma