/styled-normalize

global normalize.css for styled-components

Primary LanguageJavaScriptMIT LicenseMIT

styled-normalize

Single file with normalize.css for your styled-components

Original normalize.css copied and adapted from necolas/normalize.css

Usage

npm install --save styled-normalize styled-components

JavaScript

// ----- styles/index.js
import styledNormalize from 'styled-normalize'
import { injectGlobal } from 'styled-components'

export default () => injectGlobal`
  ${styledNormalize}

  body {
    padding: 0;
    background-color: black;
  }
`

// ----- client.js
// ... imports
import baseStyles from './styles/index'

const render = () => {
  baseStyles()

  ReactDOM.render(<AppContainer />, document.getElementById('app-root'))
}

render()

With named import

// ES Modules
import { normalize, version } from 'styled-normalize'

// CommonJS
const { normalize, version } = require('styled-normalize')

ServerSide Rendering

Styled-components supports SSR, you can read discussion or open RURARAR