styled-sanitize

Sanitize.css for your styled-components

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
styled-sanitize
501.2.02 years ago6 years agoMinified + gzip package size for styled-sanitize in KB

Readme

styled-sanitize
Single file with sanitize.css for your styled-components Original sanitize.css copied and adapted from jonathantneal/sanitize.css

Usage

```bash npm install --save styled-sanitize styled-components ```

JavaScript

```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(, document.getElementById('app-root')) } render() ``` With named import ```js // 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