From icon fonts to svg icons. How to avoid DRY code in template -
i'm switching older gliphycons/font-awesome icons modern , lighter svg font system.
my question is: need code above in every part of website?
<svg class="myicon myicon-hello"><use xlink:href="assets/symbol-defs.svg#myicon-hello"></use></svg>my hello text
do need code in everywhere?
is there alternative way?
can load assets/symbol-defs.svg
1 time , call using icon name?
you inline symbol-defs.svg
file in page, use simpler:
<svg class="myicon myicon-hello"><use xlink:href="#myicon-hello"></use></svg>my hello text
Comments
Post a Comment