Flash of unstyled text (FOUT) with self-hosted font
I'm facing a case of "Flash of unstyled text (FOUT)".
I'm using a custom font, self-hosted:
The vite build will parse that url and make it available like so:
The issue I'm facing is that the text flickers from browser default to my custom font. I've changed
If I add this:
the problem is solved.
But... that href is dynamically built by vite using a random hash.
Is there another way to prevent this?
I'm using a custom font, self-hosted:
The vite build will parse that url and make it available like so:
http://localhost/build/assets/ConcertOne-Regular-56d2074a.ttf.The issue I'm facing is that the text flickers from browser default to my custom font. I've changed
font-display from swap to block. It no longer flickers, but it takes about half a second to render.If I add this:
the problem is solved.
But... that href is dynamically built by vite using a random hash.
Is there another way to prevent this?
