postcss-reset-important

0.2.0 • Public • Published

PostCSS plugin for reseting all styles using !important, and making your own styles !important. Mostly useful for browser extension content scripts and their CSS.

.foo {
  color: red;
}
.foo {
  margin: 0 !important;
  /* bunch of other stuff */
 
  color: red !important;
}

Usage

postcss([
  require('postcss-reset-important'),
])

Options

requireExplicit: boolean

Requires you to use the reset property to enable the transform for a rule. Defaults to false

noImportant: boolean

Doesn't use !important in the generated reset styles, and doesn't add it for your own styles.

reset

The 'reset' property can be used to control the plugin. If requireExplicit isn't set, the default is reset: true.

You can explicitly define it like so:

.foo {
  reset: true;
  color: red;
}

You can also disable the resets for an element.

.foo {
  reset: false;
  color: red;
}

TODO: add extra reset options for various html tags that generate different resets.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    0
  • 0.1.1
    0

Package Sidebar

Install

npm i postcss-reset-important

Weekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • greenjello