With NextJS, the google font is cached at build time, and is then served from the application domain, so there will be no call to google fonts for the clients, this also eliminated layout shifts.
For this to work I had to allow to specify the fontFamily when creating the MUI theme, as this cached font will have a special name like __Nunito_14f33d. Out default theme in UI assumes the font will be available as Nunito.
In this PR:
Notice
With NextJS, the google font is cached at build time, and is then served from the application domain, so there will be no call to google fonts for the clients, this also eliminated layout shifts. For this to work I had to allow to specify the fontFamily when creating the MUI theme, as this cached font will have a special name like
__Nunito_14f33d
. Out default theme in UI assumes the font will be available asNunito
.