backdrop-contrib / font_awesome

Include Font Awesome Icons via CSS classes in your Backdrop CMS website
https://backdropcms.org/project/font_awesome
GNU General Public License v2.0
2 stars 4 forks source link

Add support for v4 shims with v5 #15

Closed bugfolder closed 1 year ago

bugfolder commented 2 years ago

FontAwesome v5 renamed some icons, which breaks some v4 icon names. But FontAwesome also provides a shim file that restores compatiblity with v4 while allowing one to use all the goodness of v5. It would be nice to offer that as a option, which the attached PR does.

To see the difference, put this code in a page and compare the 3 configuration settings:

<p>
FontAwesome 4 icons (bandcamp, cart): <i class="fa fa-bandcamp"></i>, <i class="fa fa-shopping-cart"></i>
</p>

<p>
FontAwesome 5 icons (bandcamp, cart): <i class="fab fa-bandcamp"></i>, <i class="fas fa-shopping-cart"></i>
</p>

"v4" and "v5" don't display all of the icons, but the "v5 + shims" option will display both pairs of icons.

fontawesome

yorkshire-pudding commented 1 year ago

Hi @bugfolder - Thank you for your contribution and sorry it has sat ignored for so long. I've just taken over the maintainer-ship of this module so it doesn't get too neglected. Your change looks mostly good, but needs a rebase (after #11) and it probably makes sense (if the shims work with that version) to update it to 5.15.4 or could match the versions with shims if that works; up to you.

Thanks

bugfolder commented 1 year ago

I rebased in a new PR.

I observe that now there are two v5 options: v5.2 and v5.15. That suggests that instead of making the shim option one of the radio buttons, the shim choice should be a separate checkbox that would apply to either of the v5 options (and/or any future v5 additions). Would you agree? If so, I'll update the PR.

yorkshire-pudding commented 1 year ago

@bugfolder - Yes - that makes sense. Thank you

bugfolder commented 1 year ago

PR updated, ready for review.