XF 2.1 FontAwesome CSS pseudo elements not working after 2.1 upgrade

Jean-Baptiste

Well-known member
Hello,

I know 2.1 made some changes with FontAwsome.

Now, CSS pseudo elements are not working anymore.

Here is an example :
Symfony_2018-11-21_10-14-05.png


And here was the original CSS :

Code:
.p-navEl [data-nav-id=forums]:before{
     font-family: FontAwesome;
     content: "\f27a";
     padding-right: 5px;
}

Any ideas on how to fix this ?

Best regards,
Jean-Baptiste
 
Also add this because there are multiple font weights available:
Code:
font-weight: min(@xf-fontAwesomeWeight, @faWeight-regular);
That wouldn't be correct. If you have your Font Awesome weight style set to solid, then the icons would end up being regular weight.

We'd recommend doing something similar to this instead:
Less:
.p-navEl [data-nav-id=forums]:before{
   .m-faBase();
   .m-faContent("\f27a");
   padding-right: 5px;
   vertical-align: middle;
}
The vertical alignment is optional but it looks a bit off to me without it.
 
'Font Awesome 5 Pro'
Also add this because there are multiple font weights available:
Code:
font-weight: min(@xf-fontAwesomeWeight, @faWeight-regular);
That wouldn't be correct. If you have your Font Awesome weight style set to solid, then the icons would end up being regular weight.

We'd recommend doing something similar to this instead:
Less:
.p-navEl [data-nav-id=forums]:before{
   .m-faBase();
   .m-faContent("\f27a");
   padding-right: 5px;
   vertical-align: middle;
}
The vertical alignment is optional but it looks a bit off to me without it.

And how can I do for FontAwesome 4 icons ?
 
We'd recommend doing something similar to this instead:
Less:
.p-navEl [data-nav-id=forums]:before{
.m-faBase();
.m-faContent("\f27a");
padding-right: 5px;
vertical-align: middle;
}

For some reason, if I try to use the Twitter icon using this code it doesn't work (f099). It does work with other icons that I've tried.

Any thoughts on why that may be?
 
All icons everywhere... all the font-awesome icons.... in the forum and in admin cp.

Disabling all add-ons does not fix them.

This is after upgrading from 1.5 to 2.1.
 
How can I make a fa icon solid in appearance? This is my current css

.label.label--btmTabloid
{
&:before {
.m-faBase();
.m-faContent("\f619");
color: white;
padding-right: 5px;
vertical-align: middle;
}
}
 
Back
Top Bottom