Alongside excellent ion-icons I would like to use my own. I have them both as SVG and also as an icon font (done using icomoon.io online font builder).
Important to me is to make my icons adhere to the theme (using color defaults) but also be stylable with specific colors (using color attribute)
in ionic-v3 it was done using css+font. In ionic-v4, I am told (on ionic slack forum, by mike) icon font is no longer an option. Suggestion is to use src attribute just so:
<ion-icon src="/path/to/external/file.svg"></ion-icon>
The problem with it, besides being less elegant then just using the ‘name’ attribute is styling - it does not react to color attribute. I tried it.
Options that I considered are
- forking ion-icon repo. I hate it because I want downstream fixes
- forking font awesome angular control. Not good because I want the same attributes as ion-icon
- as above, except wrapping into something e.g. div that uses ionic styling. doable but a gut feeling there must be a better solution
Ideally, IMHO, ion-icon should be split into a web component for any set of gliphs adhering to certain principles (e.g. naming, that will make switching between ios and mg easy), AND a separate extendable set of icon glyphs.
Mike suggested I do a pull request. Before I do so, I would like to hear your opinions.