?
avatar Magnytu2
Magnytu2
20 Feb 2021

Hello following the addition of an icon on a menu link or a module, the font changes.

Capture d’écran 2021-02-19 à 09 17 15

avatar Magnytu2 Magnytu2 - open - 20 Feb 2021
avatar joomla-cms-bot joomla-cms-bot - change - 20 Feb 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Feb 2021
avatar ReLater
ReLater - comment - 21 Feb 2021

I presume that you used the field "Link Class" of the menu item where you entered a font class like "fa fa-home". Because it's the class of the anchor <a> I would say the behavior is correct somehow and I would use an override.

Setting no image but fill the Image Class and use it in override as a SPAN class if no image provided.

Or maybe easier: CSS to force that only the ::before part of the <a> uses font-family: "Font Awesome 5 Free";.

As long as there is no specific setting "Icon Class" or something similiar I think any other solution in core would be just strange when a user defines a "Link Class"

avatar Magnytu2
Magnytu2 - comment - 21 Feb 2021

You are a thousand times right. You must actually use Font Awesome 5. fa fa-homme> fas fa-home
How to put a small space to the right of the icon? One space is not enough.

avatar Magnytu2
Magnytu2 - comment - 21 Feb 2021

@ReLater After checking, it works fine on Safari, but not Firefox or Chrome.
Capture d’écran 2021-02-21 à 16 45 39

avatar ReLater
ReLater - comment - 21 Feb 2021

The CSS is clear here.

The HTML

<a href="/" class="fa fa-home" aria-current="page" tabindex="0">Home</a>

The CSS for <a> AND its ::before part

.fa, .fas, [class^="icon-"], [class*=" icon-"] {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

From my point of view your "Accueil" is not the same font-family like "Blog" (compare the lower ls.) Any browser falls back in another font-family in cases like this if it doesn't know what to do ;-)

avatar drmenzelit
drmenzelit - comment - 22 Feb 2021

@N6REJ as the icon expert can you maybe have a look here?

avatar brianteeman
brianteeman - comment - 22 Feb 2021

iirc you need to use just "fa-home" as the class and then make sure that there is a class which will still target the icon something like .mod-menu li [class^="fa-"]::before

its a css issue not anything really specific to fonts

avatar chmst chmst - change - 6 Jul 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-07-06 17:45:29
Closed_By chmst
avatar chmst chmst - close - 6 Jul 2021
avatar chmst
chmst - comment - 6 Jul 2021

Cosing as the pr #34658 should solve this issue

Add a Comment

Login with GitHub to post a comment