Fontawesome always reloading icons - css

I upgraded from Fontawesome 3 to Fontawesome 5.
Now I got several problems. If I am just linking the font-awesome.min.css in the head, the icons are not loading. I just see squares.
If I link the all.css and tha all.js in the head, I works. So the icons are shown correctly. But everytime, I am clicking any Button and the page is realoding, it takes around half a second to reload the icons. In the previous Version it worked without the js and the icons weren't reloading at all.
I am not sure why it is behaving like this. Maybe because all the <i ...> are converted into svg?
Do you have any hints what I can do?

The class names changed.
In FontAwesome 3:
<i class="icon-thumbs-up"></i>
In FontAwesome 5:
<i class="fas fa-thumbs-up"></i>
You should look them up here and change them manually.

Related

Which fontawesome file should I include and why others do not work

I am working on a WordPress theme and tried many times to add fontawesome icons. Finally, by adding different fontawesome CSS files I found few of them works well but not others.
Please tell me why others do not work and which one should I use.
all.min.css file shows this result.
I have used the different to see which one works. "fa/far/fad/fas"
<div class="fa-3x">
<i class="fad fa-camera"></i>
<i class="fas fa-fire-alt"></i>
<i class="fa fa-bus-alt"></i>
<i class="far fa-fill-drip"></i>
</div>
And the functions.php file where I have added the CSS file to include in the header file.
...
//FontAwesome CSS file
wp_enqueue_style( 'epostlite-fontawesome', get_template_directory_uri() . '/fontawesome/css/all.min.css' );
...
I used version 5
Why "fad" and "far" shows a rectangle instead of the icon?
Why "fontawesome.min.css" and "brands.min.css do not work?
Why "fad" and "far" shows a rectangle instead of the icon?
Because fad & far are pro icons so both will not work in free version.
Why "fontawesome.min.css" and "brands.min.css do not work?
This both will work but you need to add one more css, which is
wp_enqueue_style('font-awesome-solid', get_template_directory_uri() . '/assets/css/font-awesome5/solid.min.css');
after adding solid.min.css you will get same result as all.min.css
But preferable is if you are using font awesome version 5 then just use all.min.css, no need to include all of them differently. you can check it from here.
Instead adding more & differrent kind of css you can fix the problem in less then 2 mins. Simple replacement of /font-awesome/5.13.0/css/fontawesome.min.css with /font-awesome/5.13.0/css/all.min.css and also font-awesome/5.13.0/js/fontawesome.min.js with /font-awesome/5.13.0/js/all.min.js can fix this issue. I prefer to use cdnjs
https://youtu.be/_GV_pEmLCLU

Glyphicon icon not displayed

I use glyphicon icons in my project, I use bootstrap 3.0.0 .
I have problem to display glyphicon-option-vertical icon, it just not displaed!
Here how I use it:
<span class="glyphicon glyphicon-option-vertical"></span>
While all other icons displayed fine.Any idea why this specific icon is not displayed?
Probably it's not declared in your Bootstrap CSS file. You might need to download the latest bootstrap from GitHub. Here you can find the fonts files
https://github.com/twbs/bootstrap/tree/master/fonts

Issue with Awesome Font Icons

I'm stucking on a little issue with awesome fonts icons. I've a wordpress website and I use awesome icons, in particular "battery" icons.
In 1st page I can see the battery icon, but in 2nd page I can't see battery icon, just white space, anyway in 2nd page I can see all icon types, except battery icon...
I can notice that in battery icon I don't see the code ::before in tags...
maybe this could be the issue... ?!
<i class="fa fa-battery-full"></i>
where I see the icon the code is:
<i class="fa fa-plug">::before</i>
Have you tried the last version of FA? try to change the version
Download Here
Maybe the FA that your used is old, Try that.

Material Icons vs Material Design Icons

There are two ways to use Materilize Icon:
<i class="mdi-ICON-NAME"></i>
<i class="material-icons">ICON_NAME</i>
In the official site I did not find guide or icon chart for using the font in this way <i class="mdi-ICON-NAME"></i> but there is guide on how to use the icon in this way <i class="material-icons">ICON_NAME</i> here.
So, when official site doesn't have guide on how to use the icon in this way <i class="mdi-ICON-NAME"></i>. Then why is it defined all over the stylesheet (materialize.css).
Also, if I need to call the icon this way <i class="material-icons">ICON_NAME</i> then I need to link one for font file. Eg.<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">. Hence, I feel that 2 fonts will be loaded into the DOM which is not needed, right?
My quesiton is: Where can I find Icon chart if I need to use icon in this way <i class="mdi-ICON-NAME"></i>?
I got it answered by Materialize team:
https://github.com/Dogfalo/materialize/issues/1824#issuecomment-125949178
For question: Where can I find Icon chart if I need to use icon in this way <i class="mdi-ICON-NAME"></i>
I got answer: The mdi type icons are being phased out for the official google sources, that's why you won't find the old chart in the documentation. A complete list of the new icons can be found in https://www.google.com/design/icons/
For question: Why not just delete all the mdi icons and css defined as new icons are already offered by google, isn't it?
I got answer: Because that would suddenly break all the user implementations, so this way it can be phased out gradually, giving people time to update their icons.
If you really need to check the old implementation, you can go through the commit history from https://github.com/Dogfalo/materialize/blob/master/icons.html and look at a version before the google icons were added.
You can find the full list of icons here https://www.google.com/design/icons/
The naming is mdi-category-iconname.
An example:
<i class="mdi-action-search"></i>

HTML/CSS: Font-Awesome Icons Not Appearing

For some reason the font-awesome social media icons refuse to show up on any browser. All other icons seem to work perfectly fine though... I've included a photo of the page opened in Mozilla with inspect element(linked due to no reputation). The only loaded css files are bootstrap and awesome-font.
It looks like you thought the text description of stacks was the class names. Icon stacks should look like this, there is no on class:
<span class="icon-stack">
<i class="icon-minus icon-stack-base"></i>
<i class="icon-camera icon-light"></i>
</span>
In your example, the second class overwrites the first class. This is because your using both classes on the same element, instead of stacking them.

Resources