Skip to content

PostCSS plugin to remove particular rules from the stylesheet

License

Notifications You must be signed in to change notification settings

chrishinrichs/postcss-remove-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostCSS Remove Rules Build Status

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.

About

PostCSS plugin to remove particular rules from the stylesheet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors