Next.js Discord

Discord Forum

Preloading fonts based on feature flag

Unanswered
Sporting Lucas Terrier posted this in #help-forum
Open in Discord
Avatar
Sporting Lucas TerrierOP
Im changing global fonts using this logic. But there's a small issue to that. I need to update this logic, this is done after initial render. I need to load the styles before as this is causing a delay in loading styles for new designs. How can i pre load these fonts? I was thinking of using conditional font rendering inside the head tag but ig at that time the flags wont be available.
Image

0 Replies