storefront icon indicating copy to clipboard operation
storefront copied to clipboard

Improve Font Awesome integration

Open uok opened this issue 5 years ago • 4 comments

Thanks for the great Storefront theme!

When trying to use the latest Font Awesome via CDN, I noticed that currently it is only possible to use wp_dequeue_style( 'storefront-icons' ); - but this removes font files AND icon definitions.

My suggestion is to split the styles into icons.css (storefront-icons) and fontawesome.css (font-awesome) Then you can use e.g.

wp_dequeue_style( 'font-awesome' );
wp_enqueue_style( 'font-awesome-cdn', '//use.fontawesome.com/releases/v5.8.1/css/all.css' );

Thanks!

uok avatar Mar 24 '19 08:03 uok

+1 on this one

ben72 avatar Jun 27 '19 22:06 ben72

It would be really great if this is implemented, since Font Awesome now constantly releases new icons every couple of weeks. Since version 5.8.1 which is included with Storefront several 100 icons have been added/updated.

uok avatar Sep 27 '19 17:09 uok

It would be so great if this change made it into the next release. Font Awesome v5.8.1 is from 2019-03-21, current version is 5.12.1 Thanks!

uok avatar Feb 28 '20 13:02 uok

Came across this issue whilst looking for ways to load FA from our own CDN instead of the server.

I agree it would be better if enqueuing FA a different way, or detached to the styles would make things more flexible, so people can enqueue whichever version they like.

As there's currently no other solution we can think of, we resulted in dequeuing icons.css from Storefront, copying to our child theme and modifying the URLs.

As we load our CSS and JS from the CDN, changing the URLs from relative ../../../assets/fonts to absolute /wp-content/themes/storefront/assets/fonts seem to load the font from the CDN instead of our server.

Unfortunately, this is not a great solution because it won't work for sites nested in folders and we'll have to remember to update our version of icons.css every time Storefront is updated, but at least it seems to resolve our issue for now.

p.s our approach might help with #524

glagonikas avatar Aug 27 '21 19:08 glagonikas