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

Commit

Permalink
Add FontFaceObserver to remove FOIT; Delete unused _fonts.css
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegach committed May 1, 2016
1 parent b911321 commit 6e9d316
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
5 changes: 5 additions & 0 deletions html.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class Root extends Component {
<title>{title}</title>
{ favicons }
{ cssLink }
{/* TODO: How to bundle this script with the rest of them? It didn’t work
in Safari when I did so.
*/}
<script src="//npmcdn.com/fontfaceobserver@1.7.1/fontfaceobserver.js"></script>
<script dangerouslySetInnerHTML={{ __html: config.js.font }} />
</head>
<body>
{/* TODO: How to move this script into the <head>? Doing so gives an
Expand Down
10 changes: 0 additions & 10 deletions styles/modules/_fonts.css

This file was deleted.

12 changes: 7 additions & 5 deletions styles/modules/_typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ body {
line-height: var(--lineHeight-4);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
font-family: var(--webFont);
font-weight: normal;
letter-spacing: calc(var(--letterSpacing-caps)/2);
.webfonts-loaded {
& h1, & h2, & h3, & h4, & h5, & h6,
& .h1, & .h2, & .h3, & .h4, & .h5, & .h6 {
font-family: var(--webFont);
font-weight: normal;
letter-spacing: calc(var(--letterSpacing-caps)/2);
}
}

.fontFamily-inherit { font-family: inherit }
Expand Down
2 changes: 1 addition & 1 deletion styles/modules/_variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

:root {
/* Typography */
--webFont: 'league_spartanregular';
--webFont: 'leagueSpartan-bold';

--lineHeight-1: 1;
--lineHeight-2: 1.125;
Expand Down
3 changes: 1 addition & 2 deletions styles/styles.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import '../node_modules/normalize.css/normalize.css';

@import './modules/_variables.css';
/*@import './modules/_fonts.css';*/
@import './modules/_globals.css';
@import './modules/_typography.css';
@import './modules/_typeScale.css';
Expand All @@ -21,7 +20,7 @@
@import './components/_stickyFooter.css';

@font-face {
font-family: 'league_spartanregular';
font-family: 'leagueSpartan-bold';
src: url('./leaguespartan-bold-webfont.eot');
src: url('./leaguespartan-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('./leaguespartan-bold-webfont.woff2') format('woff2'),
Expand Down

0 comments on commit 6e9d316

Please sign in to comment.