I recently found out, that using @font-face in styled-components in a gatsbyjs-project causes the page to flicker and request the font on each render. Just move "@font-face" to a font.css file and import it in the layout component. No more flickering!
![Cover image for Don't use @font-face in styled-components with GatsbyJS](https://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb1gt6w6pzpndak73rwfn.jpg)
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
Styled components recommends
font-display: fallback;
to take care of the flicker.styled-components.com/docs/faqs#ho...