Closed GonzaloCalandria closed 4 years ago
Hi @GonzaloCalandria. Just use 2x
. Like so
<FontAwesomeIcon icon="spinner" size="2x" />
@robmadole but if I use only 2x the icon gets smaller. Here's a screenshot.. the icon in the middle is 2x
Here's my react code for better understanding
<FontAwesomeIcon icon={this.mySwitchFunction(socialLogo)} size="fa fa-2x" />
Sounds like you might have some CSS on the parent that is messing with things. What is the computed font-size
for the Instragram and LinkedIn icons compared to the Facebook icon?
Smallest is 16px and biggest is 32px. But looking fontawesome website, it allows fa-2x. Maybe I have an old version of this react-fontawesome?
This still sounds like a CSS issue to me. If you can provide a reproducible test case we'll be happy to take a look. I don't think it's going to be the version of react-fontawesome. The CSS for sizing is part of the @fortawesome/fontawesome-svg-core
package.
Actually I think it is.. the thing is that I'm using AEM SPA (Adobe Experience Manager) and AEM uses font awesome as a core framework, so maybe that's why it's overwriting some stylings. Is there a way to maybe update react-fontawesome to work with the fa-2x feature?
@GonzaloCalandria if you can provide a test case we'll take a look. If there is a bug with react-fontawesome and the handling of fa-2x
we'll get it fixed. But until I can see the root cause there isn't much I can do.
I'm using the size "fa fa-2x" and I'm seeing the following error in the developer console of Chrome.
Failed prop type: Invalid prop
size
of valuefa fa-2x
supplied toFontAwesomeIcon
, expected one of ["lg","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].I'm using the following version in my package.json file