Specify @font-display when defining custom fonts in your theme
Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading.
@font-face {
font-family: 'Roboto Mono', monospace;
src: url(fonts/roboto-mono-v12-latin-regular.woff2) format('woff2'),
url(fonts/roboto-mono-v12-latin-regular.woff) format('woff'),
url(fonts/roboto-mono-v12-latin-regular.ttf) format('truetype');
font-display: optional;
}
@font-face {
font-family: 'Roboto Mono', monospace;
src: url(fonts/roboto-mono-v12-latin-700italic.woff2) format('woff2'),
url(fonts/roboto-mono-v12-latin-700italic.woff) format('woff'),
url(fonts/roboto-mono-v12-latin-700italic.ttf) format('truetype');
font-weight: 700;
font-style: italic;
font-display: optional;
}
--