FlowingCode / FontAwesomeIronIconset

Iron iconset based on FontAwesome
https://www.flowingcode.com/en/open-source/
Apache License 2.0
16 stars 6 forks source link

Generate a subset of icons #68

Open javier-godoy opened 1 year ago

javier-godoy commented 1 year ago

As discussed in #65, "the 6 bundled FA iconsets are adding a bunch to page load times; it's like 18mb in full".

To do: implement a mechanism that allows generating code with only a subset of icons.

GrandyB commented 1 year ago

For us, we only use Regular and Solid.

We initially were going to just include all Regular and Solid icons (ignoring the other 4 variations), but in the end I created a utility for our org that extracts usages of FontAwesome.*.* from our codebase, and then copies the relevant found icon names from the FA6-provided folder of SVGs into a separate folder to then put into the generator's /icons folder. Thus making it a very specific set of icons instead of them all. 18mb of svgs in our pages' head turned into 106kb.

e.g. 'FontAwesome.Regular.HOUSE' in codebase -> HOUSE -> house.svg -> copies from /fa6/svgs into /svg_subset/regular/house.svg

I implemented some redundancy, as in - if it found Regular.HOUSE, it also moved across Solid.HOUSE even if that wasn't used in the codebase, just incase we'd want to switch it. Perhaps an unnecessary redundancy.

So, ways to restrict both which variations to use, and even more finely grained down to which individual icons... would be great features.