Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

styled-reset

zacanger226.2kMIT4.5.2TypeScript support: included

Eric Meyer's Reset CSS for styled-components

css, reset, reset.css, styled-components

readme

styled-reset

Donate

npm version CircleCI

Eric Meyer's Reset CSS for styled-components

Also see styled-normalize from Sergey Sova.


Installation:

npm i styled-reset

Usage:

Styled Components 4+

import * as React from 'react'
import { Reset } from 'styled-reset'

const App = () => (
  <React.Fragment>
    <Reset />
    <div>Hi, I'm an app!</div>
  </React.Fragment>
)

You can also use the default export or named export (lowercase) in your own global style:

import * as React from 'react'
import { createGlobalStyle } from 'styled-components'
import reset from 'styled-reset'

const GlobalStyle = createGlobalStyle`
  ${reset}
  /* other styles */
`

const App = () => (
  <React.Fragment>
    <GlobalStyle />
    <div>Hi, I'm an app!</div>
  </React.Fragment>
)

export default App

Styled Components 3.x

If you're using Styled Components version 3.x or 2.x, you'll need to use the injectGlobal api instead (and install `styled-reset@1.7.1`):

import { injectGlobal } from 'styled-components'
import reset from 'styled-reset'
injectGlobal`
  ${reset}
`

reset is also available as a named export:

import { reset } from 'styled-reset'

Credits

All credit goes to Eric Meyer for reset.css. reset.css is public domain (unlicensed).

LICENSE

changelog

Changelog

Only notable changes will be recorded here. Most updates are updating dev dependencies or tweaking docs.

4.4.0

Switch to MIT license.

4.2.0

Add module and types fields in package.json, with ESM build

4.1.0

Switch to TypeScript

4.0.0

  • Switch to LGPL-3.0 license

3.0.0

  • Remove Flow support
  • Bump engines field to Node 10

2.0.0