Skip to content

asundlihardig/styled-normalize

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

styled-normalize

Single file with normalize.css for your styled-components

Original normalize.css copied 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

About

global normalize.css for styled-components

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%