1
0
Fork 0
forked from forgejo/forgejo

Fix FOUC on Firefox (#1728)

Firefox users will experience a flash of unstyled content on loading
various pages, this patch will fix this issue using Filament Groups
loadCSS library to asynchronously load the CSS responsible for the FOUC.

Will fix #1698.

Signed-off-by: Sondre Nilsen <nilsen.sondre@gmail.com>
This commit is contained in:
Sondre Nilsen 2017-05-31 03:05:49 +02:00 committed by Lunny Xiao
parent 642f844735
commit 24859fe5b6
4 changed files with 17 additions and 2 deletions

View file

@ -23,7 +23,8 @@
{{end}}
<link rel="shortcut icon" href="{{AppSubUrl}}/img/favicon.png" />
<link rel="stylesheet" href="{{AppSubUrl}}/assets/font-awesome-4.6.3/css/font-awesome.min.css">
<link rel="preload" href="{{AppSubUrl}}/assets/font-awesome-4.6.3/css/font-awesome.min.css" as="style" onload="this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="{{AppSubUrl}}/assets/font-awesome-4.6.3/css/font-awesome.min.css"></noscript>
<link rel="stylesheet" href="{{AppSubUrl}}/assets/octicons-4.3.0/octicons.min.css">
{{if .RequireSimpleMDE}}
@ -53,7 +54,8 @@
{{end}}
<style class="list-search-style"></style>
<!-- Open Graph -->
<script src="{{AppSubUrl}}/js/libs/loadCSS.min.js"></script>
<script src="{{AppSubUrl}}/js/libs/cssrelpreload.min.js"></script>
{{if .PageIsUserProfile}}
<meta property="og:title" content="{{.Owner.Name}}" />
<meta property="og:type" content="profile" />