svg-icon
svg-icon copied to clipboard
resolve <defs>
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.
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.
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.