1.2.0 • Published 3 years ago

styled-sanitize v1.2.0

Weekly downloads
233
License
MIT
Repository
github
Last release
3 years ago

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

1.2.0

3 years ago

1.1.3

3 years ago

1.1.2

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago