From bae41289cf5c2043c9b1795ab6df34477538bcdd Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 24 Nov 2021 13:01:07 +0100 Subject: Preload web fonts to minimize flash of invisible text. --- views/head.pug | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/views/head.pug b/views/head.pug index 2b7858e..0af064c 100644 --- a/views/head.pug +++ b/views/head.pug @@ -1,10 +1,17 @@ //- vim:ts=4:sw=4: meta(name="viewport" content="width=device-width,height=device-height,initial-scale=1") -link(rel="icon" href="/favicon.svg") +link(rel="icon" type="image/svg+xml" href="/favicon.svg") link(rel="stylesheet" href="/fonts/fonts.css") link(rel="stylesheet" href="/style.css") +link(rel="preload" as="font" type="font/woff2" crossorigin href="fonts/SourceSerif4-Regular.woff2") +link(rel="preload" as="font" type="font/woff2" crossorigin href="fonts/SourceSerif4-Semibold.woff2") +link(rel="preload" as="font" type="font/woff2" crossorigin href="fonts/SourceSerif4-It.woff2") +link(rel="preload" as="font" type="font/woff2" crossorigin href="fonts/SourceSans3-Regular.woff2") +link(rel="preload" as="font" type="font/woff2" crossorigin href="fonts/Dingbats.woff2") +link(rel="preload" as="font" type="font/woff2" crossorigin href="fonts/NotoEmoji.woff2") + mixin forumpost(row,show_buttons) .post .head -- cgit v1.2.3