Single file with normalize.css for your styled-components
Original normalize.css copied from necolas/normalize.css
npm install --save styled-normalize styled-components
// ----- 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')
Styled-components supports SSR, you can read discussion or open RURARAR