Created
June 18, 2016 20:04
-
-
Save KyleAMathews/9b03aeb355eb9276b4f333a3ee35e054 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactDOM from 'react-dom/server' | |
import React from 'react' | |
import Typography from '../../src/' | |
import GoogleFont from '../../src/components/GoogleFont' | |
import theme from '../../src/themes/us-web-design-standard' | |
const typography = new Typography(theme) | |
// Hot reload typography in development. | |
if (process.env.NODE_ENV !== 'production') { | |
typography.injectStyles() | |
if (typeof document !== 'undefined') { | |
const googleFonts = ReactDOM.renderToStaticMarkup(React.createFactory(GoogleFont(theme))()) | |
const head = document.getElementsByTagName('head')[0] | |
head.insertAdjacentHTML('beforeend', googleFonts) | |
} | |
} | |
export default typography |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment