Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Font Awesome integration #1089

Open
uok opened this issue Mar 24, 2019 · 4 comments
Open

Improve Font Awesome integration #1089

uok opened this issue Mar 24, 2019 · 4 comments
Labels
type: enhancement The issue is a request for an enhancement.

Comments

@uok
Copy link
Contributor

uok commented Mar 24, 2019

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!

@tiagonoronha tiagonoronha added the type: enhancement The issue is a request for an enhancement. label Mar 25, 2019
@ben72
Copy link

ben72 commented Jun 27, 2019

+1 on this one

@uok
Copy link
Contributor Author

uok commented Sep 27, 2019

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
Copy link
Contributor Author

uok commented Feb 28, 2020

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!

@glagonikas
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

4 participants