Comments (5)
Just to clarify, next-google-fonts
offers non-priority/asynchronous loading for Google Fonts, whereas the experimental font optimization changes are priorirty/synchronous.
I had a great convo with @prateekbh about this and you can read more here: vercel/next.js#16065
Cheers for the heads up! Perhaps it's worth me adding to the README?
from next-google-fonts.
FWIW I totally enjoyed brain storming with you on the discussion. This is a great solution if you decide to load fonts in a non-priority/asynchronous manner and would recommend.
from next-google-fonts.
Thanks, @joe-bell for the clarification! I think given that NextJS 10 moves this feature from experimental to core it's probably worth updating the README. The quickest short-term solution might just be to link to this ticket to save you from answering the same question multiple times over 😅
I use this package on my NextJS 9.5 install and it works fantastic, but when we update to NextJS 10, I'll probably opt for inline CSS since it's just a few fonts and FOUT can be avoided by inlining it at the trade off for a slightly longer initial load time. Thanks for the help!
from next-google-fonts.
Done! Thanks @elliottpost
from next-google-fonts.
Hello,
I am using nextjs v10 and its still confusing how to work with google fonts. Does the optimization comes by default now or not? Google page insights complains about the fonts and I have no idea how to solve it and I tried many things.
This is the code in my _document.js file but I dont see any benefits.
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&family=Roboto:wght@300;400;500&family=Work+Sans:wght@400;500;600;700&display=swap" rel="stylesheet" />
Is there anything else I should be doing? Link to a working example would be awesome.
from next-google-fonts.
Related Issues (12)
- v1.3.0 breaks - React.jsx: type is invalid HOT 3
- this package has incorrect peer dependency HOT 1
- Duplicate preload stylesheet tags HOT 6
- New version prevents multiple `<GoogleFonts>` tags HOT 2
- react-google-fonts HOT 1
- How to Use on All Pages HOT 3
- Not working on Safari HOT 7
- Guidance on using this alongside vanilla `next/head` HOT 5
- Head (`next/document`) not support passing NextHead (`next/head`) as a child. HOT 5
- Perfect in desktop, not working in mobile HOT 5
- why not useLayoutEffect hook ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-google-fonts.