Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinnymac/3e5cc7366ae8f62ca518f3a577cc3b15 to your computer and use it in GitHub Desktop.
Save vinnymac/3e5cc7366ae8f62ca518f3a577cc3b15 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