Skip to content

Instantly share code, notes, and snippets.

@KyleAMathews
Created June 18, 2016 20:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save KyleAMathews/9b03aeb355eb9276b4f333a3ee35e054 to your computer and use it in GitHub Desktop.
Save KyleAMathews/9b03aeb355eb9276b4f333a3ee35e054 to your computer and use it in GitHub Desktop.
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