Skip to content

Improve font speed by loading webfonts from HTML instead of @import

Yuto Takano requested to merge yutotakano/faster-font-load into master

Currently, there's a noticeable visual delay for the webfont to be loaded, especially with uncached resources.

The MR aims to improve upon this layout shift slightly by changing from loading webfonts with CSS @imports, to an HTML <link> stylesheet tag that would begin downloading immediately on page load even before the JavaScript engine or React is ready.

The MR also adds a preconnect line in the HTML to improve the connection speed to the actual font files on gstatic.com.

(At some point we should also review these loaded fonts, I don't think Source Code Pro is used anywhere)

Edited by Yuto Takano

Merge request reports