Set rel=preload in CSS: How-To

Instructions for importing fonts with rel="preload" attribute using CSS:

@font-face{
    font-family:fname;
    src:url(../fonts/fname.woff) format('woff'),
    url(../fonts/fname.ttf) format('truetype');
    font-weight:400;
    font-display: swap;
    rel: preload;
}

To use the rel="preload" HTML attribute when importing fonts using CSS, add the font-display: swap and rel: preload declarations to the @font-face rule.

To use the rel="preload" HTML attribute when importing fonts using CSS, add the font-display: swap and rel: preload declarations to the @font-face rule:

@font-face{
    font-family:fname;
    src:url(../fonts/fname.woff) format('woff'),
    url(../fonts/fname.ttf) format('truetype');
    font-weight:400;
    font-display: swap;
    rel: preload;
}