commit 3f9b2336c0aa8c8d6c629a90d3d606f9b5e751e6
parent 60639a6a0ee9ee79a93d998697b083314e840e9c
Author: tobi <31960611+tsmethurst@users.noreply.github.com>
Date: Sun, 2 Apr 2023 14:03:29 +0200
[bugfix/frontend] Preload css styles (#1638)
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/web/template/header.tmpl b/web/template/header.tmpl
@@ -42,7 +42,10 @@
<meta property="og:image:height" content="{{ .ogMeta.ImageHeight }}">
{{ end }}{{ end }}<link rel="shortcut icon" href="{{ .instance.Thumbnail }}" type="{{ if .instance.ThumbnailType }}{{ .instance.ThumbnailType }}{{ else }}image/png{{ end }}">
{{ if .rssFeed }}<link rel="alternate" type="application/rss+xml" href="{{ .rssFeed }}" title="{{ if .ogMeta }}{{ .ogMeta.Title }}{{ else }}{{.instance.Title}}{{ end }}">{{ end }}
- <link rel="stylesheet" href="/assets/dist/_colors.css">
+ <link rel="preload" href="/assets/dist/_colors.css" as="style">
+ <link rel="preload" href="/assets/dist/base.css" as="style">
+ {{range .stylesheets}}<link rel="preload" href="{{.}}" as="style">
+ {{end}}<link rel="stylesheet" href="/assets/dist/_colors.css">
<link rel="stylesheet" href="/assets/dist/base.css">
{{range .stylesheets}}<link rel="stylesheet" href="{{.}}">
{{end}}<title>{{ if .ogMeta }}{{ .ogMeta.Title }}{{ else }}{{.instance.Title}} - GoToSocial{{ end }}</title>