Closed david-a-wheeler closed 6 years ago
Definitively sounds realy useful. How I understand new FA5 approach, their special javascript convert <i>
tags to svgs on the client side on dom ready. Possible solutions would be convert <i>
tags directly on server or include raw svgs files in gem and with direct: true
option, return them straight away. Currently I'm usign FA5 svg icon sprites for smaller size.
I will look onto this and try to find solution. Anyway I will appreciate any help if anybody have an idea for solution or dealed with similar problem.
@david-a-wheeler Hello I've updated gem now is possible to use icon directly as svg ``` image_tag('fa5/solid/camera.svg') . It's is now possible to include font_awesome5_webfont which will include just font without javascript. Checkout docs for more info. Hope it helps.
Awesome! Thanks! I intend to check this out soon, thanks very much.
I'd like some option in fa_icon to return the underlying svg data. I don't care exactly how to request it, but it could be (for example) "direct: true". E.g., given this call:
It would return something like this:
In addition, or instead, it'd nice to have an img src="..." or at least the filename, so that I could simply refer to the asset filename (using the usual asset pipeline), and then user clients could cache it for later.
The first approach provides immediate display (but can't be cached on the user side easily), while the second one may cause a little delay but can be easily cached on the user side.
Rationale: I don't want JavaScript to always walk through HTML DOM just to figure out how to replace the "i"s with SVGs. It's slow on the client, and it doesn't work when users disable JavaScript (yes, I have such users).
Thanks!