styled-preflight
TypeScript icon, indicating that this package has built-in type declarations

8.0.1 • Public • Published

A CSS-normalizing library for styled-components, with a kick.

The original normalize.css is pulled from necolas/normalize.css, and parsed into a styled ready format. Some small additions are added, based on Tailwind’s preflight, to make the normalizing more useful for building apps.

Usage

yarn add styled-preflight

styled-components v4

// index.js
import React from 'react'
import { Normalize } from 'styled-normalize'
 
import { App } from './app'
 
const Root = () => (
  <React.Fragment>
    <Normalize />
    <App />
  </React.Fragment>
)

Alternatively, you can use the createGlobalStyle API:

// styles/index.js
import { normalize } from 'styled-normalize'
import { createGlobalStyle } from 'styled-components'
 
const GlobalStyle = createGlobalStyle`
  ${normalize}
 
  // Continue writing global styles
  body {
    background-color: black;
  }
`
 
<GlobalStyle />

Prior art

Package Sidebar

Install

npm i styled-preflight

Weekly Downloads

10

Version

8.0.1

License

MIT

Unpacked Size

6.59 kB

Total Files

8

Last publish

Collaborators

  • merelinguist