styled-sanitize
v1.2.0
Published
Sanitize.css for your styled-components
Downloads
386
Maintainers
Readme
styled-sanitize
Single file with sanitize.css for your styled-components
Original sanitize.css copied and adapted from jonathantneal/sanitize.css
Usage
npm install --save styled-sanitize styled-components
JavaScript
// ----- styles/index.js
import styledSanitize from 'styled-sanitize'
import { injectGlobal } from 'styled-components'
export default () => injectGlobal`
${styledSanitize}
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 { sanitize, version } from 'styled-sanitize'
// CommonJS
const { sanitize, version } = require('styled-sanitize')
ServerSide Rendering
Styled-components supports SSR, you can read discussion or open RURARAR