CSS-normalize library for styled-components.
The original normalize.css
is pulled from necolas/normalize.css, and parsed into styled ready format.
npm install --save styled-normalize
styled-components createGlobalStyle documentation
This is just usage example
// ----- index.js
import React from 'react'
import { Normalize } from 'styled-normalize'
import { App } from './app'
const Root = () => (
<React.Fragment>
<Normalize />
<App />
</React.Fragment>
)
For older version of styled-components this API renders to
null
// ----- styles/index.js
import styledNormalize from 'styled-normalize'
import { injectGlobal } from 'styled-components'
injectGlobal`
${styledNormalize}
// You can continue writing global styles
body {
padding: 0;
background-color: black;
}
`
You can also use named imports:
// ES Modules
import { normalize, Normalize } from 'styled-normalize'
// CommonJS
const { normalize, Normalize } = require('styled-normalize')
The MIT License