diff options
author | Sondre Nilsen <nilsen.sondre@gmail.com> | 2017-05-31 03:05:49 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-05-31 09:05:49 +0800 |
commit | 24859fe5b64925f93f5b2decee28d3bba23a5b44 (patch) | |
tree | 56555608ffc893e61482d4a11e22c86ea9b01b3a /templates | |
parent | 642f844735f50fbc531dc01a0a89d004b9ecd042 (diff) | |
download | gitea-24859fe5b64925f93f5b2decee28d3bba23a5b44.tar.gz gitea-24859fe5b64925f93f5b2decee28d3bba23a5b44.zip |
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>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base/head.tmpl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index f357b95166..6254e45435 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -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" /> |