프로젝트
GitHub에서 보기
sergeysova/styled-normalize
소개
normalize.css for styled-components
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalstyled-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
import React from 'react'
import ReactDOM from 'react-dom'
import { Normalize } from 'styled-normalize'
import { App } from './app'
const Root = () => (
<React.Fragment>
<Normalize />
<App />
</React.Fragment>
)
ReactDOM.render(<Root />, document.querySelector('#root'))
Also you can use createGlobalStyle API:
// styles/index.js
import { createGlobalStyle } from 'styled-components'
import { normalize } from 'styled-normalize'
export const GlobalStyle = createGlobalStyle`
${normalize}
// You can continue writing global styles here
body {
padding: 0;
background-color: black;
}
`
// index.js
import React from 'react'
import ReactDOM from 'react-dom'
import { GlobalStyle } from './styles'
import { App } from './app'
const Root = () => (
<React.Fragment>
<GlobalStyle />
<App />
</React.Fragment>
)
ReactDOM.render(<Root />, document.querySelector('#root'))
You can also use named imports:
// ES Modules
import { normalize, Normalize } from 'styled-normalize'
// CommonJS
const { normalize, Normalize } = require('styled-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
createGlobalStyleAPI.
Version
NO SEMVER!
Why? Because X.Y numbers in vX.Y.Z version matches X.Y in normalize.css
License
The MIT License
관련 프로젝트 살펴보기
불러오는 중…