SVG Sprite icons
SamMousa opened this issue · comments
SVG Sprite icons use a HTML snippet like this:
<svg class="icon icon-admin"><use href="/assets/e49e1d21/symbol-defs.svg#icon-admin"></use></svg>
This could be implemented with the following changes:
- Add
iconTag
, with default<i>
. This allows us to change it (developers might use different tags for things like font-awesome,<span>
for example). - Allow HTML in
iconText
.
Configuration would then be:
{
icon: 'icon icon-admin',
iconText: '<use href="/assets/e49e1d21/symbol-defs.svg#icon-admin">',
iconTag: 'svg'
}
It would be even cleaner (from a configuration perspective) if we add support for some simple string replacements:
{
icon: 'icon icon-admin',
iconUrl: "/assets/e49e1d21/symbol-defs.svg",
iconText: '<use href="{iconUrl}#icon-admin">',
iconTag: 'svg'
}
But this makes the code more complex..
Hi @SamMousa , could you make a PR? thanks