Allow multiple font weights with @next/font
See original GitHub issueDescribe the feature you’d like to request
With a <link>
to Google Foots, it is possible to request multiple weights for a single font:
<link
href="https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap"
rel="stylesheet"
/>
It seems like the @next/font, in version 13.0.0, doesn’t allow multiple weights, it takes a single value.
Describe the solution you’d like
Something like this would be great for instance:
export const roboto = Roboto({ display: 'swap', weight: ['400', '700'] })
Describe alternatives you’ve considered
<link>
still works in the meantime.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to optimize custom fonts with @next/font - larsmagnus
When using localFont from @next/font/local you can load multiple font-families or font weights by passing in an array of items to src ....
Read more >@next/font | Next.js
The font weight with the following possibilities: A string with possible values of the weights available for the specific font or a range...
Read more >Multiple font-weights, one @font-face query - Stack Overflow
Here's an example using the same font-family name with different styles and weights associated with different fonts:
Read more >How to use Font Optimization in Nextjs 13? - Medium
To enable font optimization in nextjs, you need to download the @next/font package ... How many fonts are used with the @next/font package?...
Read more >Font families with multiple font weights (Bold font is less bold ...
Do you want to request a feature or report a bug? Bug What is the current behavior? I am trying to install additional...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Multiple weights and styles are now available in
13.0.1
. Docs are being worked on to reflect the latest updates.If available use a variable font instead. E.g.
Roboto Flex
.Support for multiple weights for non variable fonts is coming soon. In the meantime you could use one const per weight.