Skip to content

Commit

Permalink
Preload FontAwesome stylesheet on page load
Browse files Browse the repository at this point in the history
  • Loading branch information
seshrs committed Jul 4, 2022
1 parent 69787fd commit 9845df8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _layouts/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
{% seo %}

{%- comment -%}
The FontAwesome stylesheet is injected by Primer Spec to defer
loading. However, we can mitigate the icon-flashing by requesting
the browser to preload the stylesheet asynchronously asap.
{%- endcomment -%}
<link rel="preload" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" as="style" crossorigin="anonymous" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr">

{%- if site.favicon %}
<link rel="icon" href="{{ site.favicon | relative_url }}">
{%- endif %}
Expand Down

0 comments on commit 9845df8

Please sign in to comment.