postcss-remove-rules
v1.0.0
Published
PostCSS plugin to remove rules by selector.
Downloads
7,676
Maintainers
Readme
PostCSS Remove Rules
PostCSS plugin to remove rules by selector.
Installation
$ npm install postcss-remove-rules
Usage
// dependencies
var fs = require("fs")
var postcss = require("postcss")
var remove = require("postcss-remove-rules")
// css to be processed
var css = fs.readFileSync("input.css", "utf8")
// process css
var output = postcss()
.use(remove({
rulesToRemove: {
'.my-class': '*' // Or an array of CSS rule props
}
}))
.process(css)
.css
Options
rulesToRemove
An object where each specified key is a CSS selector and each value is either '*''
indicating that all rules for that
selector should be removed, a string matching the CSS property name to remove (e.g. 'font-style'
), or an array of
strings containing CSS properties to be removed (e.g. ['position', 'display']
).
See PostCSS docs for examples for your environment.