From ab989c8b7ab1c0654ada2ba88473a9c424d3bb03 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 25 Jan 2016 15:08:57 +0100 Subject: [PATCH] Fix FontFaceObserver --- app/app.js | 5 +++-- app/containers/App/styles.css | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/app.js b/app/app.js index bcc450a58d..d7b5171a3b 100644 --- a/app/app.js +++ b/app/app.js @@ -25,13 +25,14 @@ const reduxRouterMiddleware = syncHistory(browserHistory); // Observer loading of Open Sans (to remove open sans, remove the tag in // the index.html file and this observer) +import styles from './containers/App/styles.css'; const openSansObserver = new FontFaceObserver('Open Sans', {}); // When Open Sans is loaded, add the js-open-sans-loaded class to the body openSansObserver.check().then(() => { - document.body.classList.add('js-open-sans-loaded'); + document.body.classList.add(styles.jsOpenSansLoaded); }, () => { - document.body.classList.remove('js-open-sans-loaded'); + document.body.classList.remove(styles.jsOpenSansLoaded); }); // Import the pages diff --git a/app/containers/App/styles.css b/app/containers/App/styles.css index 22905dec8d..c8dfcc381e 100644 --- a/app/containers/App/styles.css +++ b/app/containers/App/styles.css @@ -1,3 +1,13 @@ +/* Global styles */ + +body { + font-family: Helvetica Neue, Helvetica, Arial, sans-serif; +} + +body.jsOpenSansLoaded { + font-family: 'Open Sans', Helvetica Neue, Helvetica, Arial, sans-serif; +} + .wrapper { max-width: calc(768px + 16px * 2); margin: 0 auto;