Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-autoreset

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-autoreset

PostCSS plugin for partial styles reset

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-24.92%
Maintainers
1
Weekly downloads
 
Created
Source

PostCSS Auto Reset

Build Status NPM David DM

PostCSS plugin for automatic conditional rules reset. Useful for creation of bullet-proof styles isolation in your extension. Can be used in combination with postcss-initial.

.block {
  padding: 1em;
}

.block__element {
  margin: 1em;
}

.block--modifier {
  border: 1em;
}

.block { /* reseted */
  all: initial;
  padding: 1em;
}

.block__element { /* reseted */
  all: initial;
  margin: 1em;
}

.block--modifier { /* ignored, we don`t need to reset BEM modifiers  */
  border: 1em;
}

Options

reset

Set of properties that we use to reset rules.
Takes string or object.
Possible values:

  • 'initial' - all: initial;
  • 'sizes' - reset size properties.

Use object to create your own reset. CSS-in-JS notation is supported.

Example

postcss([ require('postcss-autoreset')({
    reset: {
      margin: 0,
      padding: 0,
      borderRadius: 0
    }
  })])

rulesMatcher

Rules filter function.
Takes string or function.
Possible values:

  • 'bem' - reset all BEM blocks and element, ignore modifiers. (naming: .block__element-modifier);
  • 'suit' - reset all SUIT CSS components and parts, ignore modifiers and states.

You can define custom rules filter to fit your styles naming.

Example

postcss([ require('postcss-autoreset')({
  rulesMatcher: (rule)=> rule.selector.match(/regexp/)
  })])

Usage

postcss([ require('postcss-autoreset')])

See PostCSS docs for examples for your environment.

Keywords

FAQs

Package last updated on 15 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc