-
Notifications
You must be signed in to change notification settings - Fork 265
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
Font Icons are always large #284
Comments
I had the same issue, in my case font awesome's CSS was just not getting loaded at all, which resulted in SVGs always showing as large as possible. You can try manually inserting the CSS into your app. I use
Based on the answers to this issue: #27 |
@evenmed Thanks, this worked for me. Upgraded from NextJS 8 to 9 and suddenly the icons were huge. Would be interesting to know what exactly changed to cause this though. Thinking maybe the internals of NextJS changing the way they do things maybe.. |
@ezeikel Hi, can you post how you solved this? Where did you copy this in _document.js? |
@adrianwix If you're also using
If you're not using Hope this helps :) |
I've put a PR up that includes some documentation on this: Can you all take a look and see if I've missed anything? |
Also, if there is a preference to either use |
Hi, thanks for answering. So I literally added styled-components to fix this bug which seemed a bit overkill. I had already @zeit/next-css so instead, I imported the styles directly in _app.js like show in the PR. Therefore removing styled-components. Thanks again. |
Worked for me just using next's built-in
|
Not sure if people are still working on this...so I just came across this issue just now, apparently when you have a combination of:
As soon as you add in the Might have to find some sort of hard coded alternative to the icons...maybe I will just crop out some images and use them as the social media buttons in place of the brand-svg-icon library. |
is...this problem potentially from a recent update, i didn't expect a message 6 minutes ago but I just had this problem (edit: fixes in this issue still works at least, guess I'll be using that for now) |
Ah then my issue is probably something different then, my solid icons work as per normal but if I import the brand icons, it scales the existing solid icons up, I haven't had a chance to debug it yet, maybe I will spawn a separate thread about it, once I get a reliable repro. |
Same issue using Astro (it was working fine with a CRA app) Solution with Astro:
Ref: https://docs.astro.build/en/guides/styling/#import-a-stylesheet-from-an-npm-package |
Thanks @semyou for raising the issue and thanks @evenmed and @svachalek for the answers. Solved my problem. |
Hi
I have seen many people complaining that icon sizes flash large at load and then resize. In my case, they stay large always and the size="sm" or "1x" doesn't do anything. Have you seen this? The fontawesome icon renders as an svg and the path comes with fixed values from the server, so no css can help it.
FYI, I am using nextjs server side rendering and this is how I import my fontawesome in my head:
import { library } from '@fortawesome/fontawesome-svg-core'
import { fab } from '@fortawesome/free-brands-svg-icons'
import { fas } from '@fortawesome/free-solid-svg-icons'library.add(fab, fas);
And then i use it in any class like this:
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
I am using chrome on mac.
Thanks for your help.
The text was updated successfully, but these errors were encountered: