Skip to content
This repository was archived by the owner on May 5, 2020. It is now read-only.

Commit 6e9d316

Browse files
committed
Add FontFaceObserver to remove FOIT; Delete unused _fonts.css
1 parent b911321 commit 6e9d316

5 files changed

Lines changed: 14 additions & 18 deletions

File tree

html.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class Root extends Component {
3131
<title>{title}</title>
3232
{ favicons }
3333
{ cssLink }
34+
{/* TODO: How to bundle this script with the rest of them? It didn’t work
35+
in Safari when I did so.
36+
*/}
37+
<script src="//npmcdn.com/fontfaceobserver@1.7.1/fontfaceobserver.js"></script>
38+
<script dangerouslySetInnerHTML={{ __html: config.js.font }} />
3439
</head>
3540
<body>
3641
{/* TODO: How to move this script into the <head>? Doing so gives an

styles/modules/_fonts.css

Lines changed: 0 additions & 10 deletions
This file was deleted.

styles/modules/_typography.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ body {
66
line-height: var(--lineHeight-4);
77
}
88

9-
h1, h2, h3, h4, h5, h6,
10-
.h1, .h2, .h3, .h4, .h5, .h6 {
11-
font-family: var(--webFont);
12-
font-weight: normal;
13-
letter-spacing: calc(var(--letterSpacing-caps)/2);
9+
.webfonts-loaded {
10+
& h1, & h2, & h3, & h4, & h5, & h6,
11+
& .h1, & .h2, & .h3, & .h4, & .h5, & .h6 {
12+
font-family: var(--webFont);
13+
font-weight: normal;
14+
letter-spacing: calc(var(--letterSpacing-caps)/2);
15+
}
1416
}
1517

1618
.fontFamily-inherit { font-family: inherit }

styles/modules/_variables.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
:root {
1010
/* Typography */
11-
--webFont: 'league_spartanregular';
11+
--webFont: 'leagueSpartan-bold';
1212

1313
--lineHeight-1: 1;
1414
--lineHeight-2: 1.125;

styles/styles.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import '../node_modules/normalize.css/normalize.css';
22

33
@import './modules/_variables.css';
4-
/*@import './modules/_fonts.css';*/
54
@import './modules/_globals.css';
65
@import './modules/_typography.css';
76
@import './modules/_typeScale.css';
@@ -21,7 +20,7 @@
2120
@import './components/_stickyFooter.css';
2221

2322
@font-face {
24-
font-family: 'league_spartanregular';
23+
font-family: 'leagueSpartan-bold';
2524
src: url('./leaguespartan-bold-webfont.eot');
2625
src: url('./leaguespartan-bold-webfont.eot?#iefix') format('embedded-opentype'),
2726
url('./leaguespartan-bold-webfont.woff2') format('woff2'),

0 commit comments

Comments
 (0)