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

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -