Open lostful opened 3 months ago
Hey @lostful! I'm here to help you with any bugs, questions, or contributions you have in mind. Let's tackle this flickering font issue together!
To fix the issue of font flickering whenever you reload your page, you can use the nuxt-fonts
module to optimize and configure web fonts in your Nuxt app. Here is how you can set it up in your .nuxtrc
file:
typescript.tsConfig.compilerOptions.noUncheckedIndexedAccess=true
modules[]=nuxt-fonts-devtools
This configuration will help in optimizing the fonts and reducing the flickering issue [1].
To continue talking to Dosu, mention @dosu.
Is this only in development?
Would you be able to provide a reproduction? π
Is this only in development?
Ah yes, this is only in development. Is that intended?
Not intended, but I did observe it previously. Need to investigate, so letβs leave it open.
same here i have the font in my css like this
@font-face {
font-family: 'Quicksand';
src: url('/fonts/quicksand/Quicksand-VariableFont_wght.ttf') format('TrueType');
font-weight: normal;
font-style: normal;
font-display: swap;
}
and the actual file is in the public directory public/fonts
maybe I should do it differently?
This looks like an upstream vite bug to me - likely caused by the fact that:
<link rel="stylesheet" href="/_nuxt/__uno.css">
returns a JS module and not CSS.
Whenever I reload my page the font flickers