You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an enhancement instead of a bug. It would be great if we could customize the options of GeistSans and GeistMono. e.g. may be we can do
importlocalFontfrom'next/font/local';// since LocalFont is not exported from next/font/localtypeLocalFont=Parameters<typeoflocalFont>[0];// omitting src, clearly we don't want that part to be customizable.exportconstGeistMono=(options?: Omit<LocalFont,'src'>)=>localFont({src: './fonts/geist-mono/GeistMono-Variable.woff2',variable: '--font-geist-mono',adjustFontFallback: false,fallback: ['ui-monospace','SFMono-Regular','Roboto Mono','Menlo','Monaco','Liberation Mono','DejaVu Sans Mono','Courier New','monospace',],
...options,});exportconstGeistSans=(options?: Omit<LocalFont,'src'>)=>localFont({src: './fonts/geist-sans/Geist-Variable.woff2',variable: '--font-geist-sans',
...options,});
Then we can allow users to customize the options they way they want, e.g. for my case, I want to prevent the monospace font from being preloaded.
constgeistMono=GeistMono({preload: false});
This syntax also matches that from next/font/google.
The text was updated successfully, but these errors were encountered:
mwskwong
changed the title
Allow customizating options of GeistSans and GeistMono
Allow options of GeistSans and GeistMono to be customizable
Nov 21, 2023
Font Name (Geist Sans/Geist Mono):
This is an enhancement instead of a bug. It would be great if we could customize the options of
GeistSans
andGeistMono
. e.g. may be we can doThen we can allow users to customize the options they way they want, e.g. for my case, I want to prevent the monospace font from being preloaded.
This syntax also matches that from
next/font/google
.The text was updated successfully, but these errors were encountered: