Skip to content

Commit

Permalink
Attempt to preload font correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadorequest committed Jun 5, 2020
1 parent e19a3d8 commit cc812da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/pageLayouts/Head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ const Head: React.FunctionComponent<HeadProps> = (props): JSX.Element => {

{/* Perf optimisation (preload normal and bold fonts because they're the most used) - See https://web.dev/uses-rel-preload*/}
{/* TODO See if it's actually a good thing, seems to conflict with WebFontLoader - See https://github.com/GoogleChrome/lighthouse/issues/10892 */}
<link rel="preload" as="font" href={'/static/fonts/NeuzeitGrotesk/font.css'} />
<link rel="preload" as="style" href={'/static/fonts/NeuzeitGrotesk/font.css'} />
<link rel="preload" as="font" href={'/static/fonts/NeuzeitGrotesk/NeuzeitGrotesk-bold.woff'} type="font/woff" crossOrigin="anonymous" />
<link rel="preload" as="font" href={'/static/fonts/NeuzeitGrotesk/NeuzeitGrotesk-bold.woff2'} type="font/woff2" crossOrigin="anonymous" />
<link rel="preload" as="font" href={'/static/fonts/NeuzeitGrotesk/NeuzeitGrotesk-black.woff'} type="font/woff" crossOrigin="anonymous" />
<link rel="preload" as="font" href={'/static/fonts/NeuzeitGrotesk/NeuzeitGrotesk-black.woff2'} type="font/woff2" crossOrigin="anonymous" />

{
SUPPORTED_LOCALES.map((supportedLocale: I18nLocale) => {
Expand Down

0 comments on commit cc812da

Please sign in to comment.