Browse Source

fix: fonts

fix/sections-for-cli-reference
Thomas Osmonson 4 years ago
committed by Thomas Osmonson
parent
commit
b58bd1b711
  1. 32
      public/static/fonts.css
  2. 47
      src/pages/_document.tsx

32
public/static/fonts.css

@ -1,32 +0,0 @@
@font-face {
font-family: 'Soehne Mono';
src: url('/static/fonts/soehne-mono-web-buch.woff2') format('woff2'),
url('/static/fonts/soehne-mono-web-buch.woff') format('woff');
font-weight: 400;
font-display: swap;
font-style: normal;
}
@font-face {
font-family: 'Soehne';
src: url('/static/fonts/soehne-web-buch.woff2') format('woff2'),
url('/static/fonts/soehne-web-buch.woff') format('woff');
font-weight: 400;
font-display: swap;
font-style: normal;
}
@font-face {
font-family: 'Soehne';
src: url('/static/fonts/soehne-web-kraftig_1.woff2') format('woff2'),
url('/static/fonts/soehne-web-kraftig_1.woff') format('woff');
font-weight: 500;
font-display: swap;
font-style: normal;
}
@font-face {
font-family: 'Soehne';
src: url('/static/fonts/soehne-web-halbfett_1.woff2') format('woff2'),
url('/static/fonts/soehne-web-halbfett_1.woff') format('woff');
font-weight: 600;
font-display: swap;
font-style: normal;
}

47
src/pages/_document.tsx

@ -1,3 +1,4 @@
import React from 'react';
import Document, { import Document, {
DocumentContext, DocumentContext,
DocumentProps, DocumentProps,
@ -38,8 +39,7 @@ export default class MyDocument extends Document<DocumentProps> {
render() { render() {
return ( return (
<Html lang="en"> <Html lang="en">
<Head /> <Head>
<body>
<link <link
rel="preload" rel="preload"
href="/static/fonts/soehne-mono-web-buch.woff2" href="/static/fonts/soehne-mono-web-buch.woff2"
@ -68,8 +68,45 @@ export default class MyDocument extends Document<DocumentProps> {
type="font/woff2" type="font/woff2"
crossOrigin="true" crossOrigin="true"
/> />
<link rel="preload" href="/static/fonts.css" as="style" /> <style
dangerouslySetInnerHTML={{
__html: `@font-face {
font-family: 'Soehne Mono';
src: url('/static/fonts/soehne-mono-web-buch.woff2') format('woff2'),
url('/static/fonts/soehne-mono-web-buch.woff') format('woff');
font-weight: 400;
font-display: swap;
font-style: normal;
}
@font-face {
font-family: 'Soehne';
src: url('/static/fonts/soehne-web-buch.woff2') format('woff2'),
url('/static/fonts/soehne-web-buch.woff') format('woff');
font-weight: 400;
font-display: swap;
font-style: normal;
}
@font-face {
font-family: 'Soehne';
src: url('/static/fonts/soehne-web-kraftig_1.woff2') format('woff2'),
url('/static/fonts/soehne-web-kraftig_1.woff') format('woff');
font-weight: 500;
font-display: swap;
font-style: normal;
}
@font-face {
font-family: 'Soehne';
src: url('/static/fonts/soehne-web-halbfett_1.woff2') format('woff2'),
url('/static/fonts/soehne-web-halbfett_1.woff') format('woff');
font-weight: 600;
font-display: swap;
font-style: normal;
}
`,
}}
/>
</Head>
<body>
<script <script
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: `(function() { __html: `(function() {
@ -84,7 +121,7 @@ export default class MyDocument extends Document<DocumentProps> {
})()`, })()`,
}} }}
/> />
{/*<link rel="preconnect" href="https://bh4d9od16a-dsn.algolia.net" crossOrigin="true" />*/} <link rel="preconnect" href="https://bh4d9od16a-dsn.algolia.net" crossOrigin="true" />
<link rel="preconnect" href="https://cdn.usefathom.com" crossOrigin="true" /> <link rel="preconnect" href="https://cdn.usefathom.com" crossOrigin="true" />
<Main /> <Main />
<NextScript /> <NextScript />

Loading…
Cancel
Save