Answer the question
In order to leave comments, you need to log in
How to get rid of an artifact with a connected font when loading a site?
A problem arose during the layout process, namely: after connecting new fonts ( Inter and Golos-Text ), artifacts appear when rendering the page. That is, within a fraction of a second after refreshing the page, I see the base font (Segoe UI), and then it changes to the one I applied (Inter).
body {
font-weight: 400;
font-size: 14px;
line-height: 1.58;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
text-size-adjust: 100%;
text-rendering: optimizeSpeed;
...
}
@font-face {
font-weight: 400;
font-family: 'Inter';
font-style: normal;
src:
url(../fonts/inter/Inter-Regular.woff2?v=3.15) format("woff2"),
url(../fonts/inter/Inter-Regular.woff?v=3.15) format("woff2");
font-display: swap;
}
body {
font-weight: 400;
font-size: 14px;
line-height: 1.58;
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
text-size-adjust: 100%;
text-rendering: optimizeSpeed;
...
}
Answer the question
In order to leave comments, you need to log in
experiment with font-display https://developer.mozilla.org/ru/docs/Web/CSS/@fon...
swap - it does just that it loads any font it can, and then replaces it with the one you need
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question