styled-normalize
CSS-normalize library for styled-components.
The original normalize.css
is pulled from necolas/normalize.css, and parsed into styled ready format.
Usage
npm install --save styled-normalize
yarn add styled-normalize
styled-components v4 / v5
Package exported normalize
and Normalize
. Normalize
is a component with global styles. normalize
is a css-normalize content to interpolate into styled component.
Use as component:
// index.js const Root = <ReactFragment> <Normalize /> <App /> </ReactFragment> ReactDOM
Also you can use createGlobalStyle
API:
// styles/index.js const GlobalStyle = createGlobalStyle` // You can continue writing global styles here body { padding: 0; background-color: black; }` // index.js const Root = <ReactFragment> <GlobalStyle /> <App /> </ReactFragment> ReactDOM
You can also use named imports:
// ES Modules // CommonJSconst normalize Normalize =
styled-components v3
If you want to use styled-normalize
with styled-components@v3
you should use prev
npm tag.
npm install styled-normalize@prev
v3 don't supports
createGlobalStyle
API.
Version
NO SEMVER!
Why? Because X.Y numbers in vX.Y.Z
version matches X.Y in normalize.css
License
The MIT License