postcss-important

0.3.0 • Public • Published

postcss-important Build Status

PostCSS plugin for annotations based !important

Installation

$ npm install postcss-important

Example

// Dependencies
var fs = require('fs')
var postcss = require('postcss')
var important = require('postcss-important')
 
// CSS to be processed
var css = fs.readFileSync('input.css', 'utf-8')
 
// Process CSS
var output = postcss()
  .use(important(css))
  .process(css)
  .css

Using this input.css:

.foo {
  /* @important */
  font-size: 12px !important;
  color: red;
}
 
.bar {
  /*
   * @important color, padding
   */
  color: red;
  font-size: 12px;
  padding: 10px;
}

You will get:

.foo {
  /* @important */
  font-size: 12px !important;
  color: red !important;
}
 
.bar {
  /*
   * @important color, padding
   */
  color: red !important;
  font-size: 12px;
  padding: 10px !important;
}

License

The MIT License (MIT)

Copyright (c) 2014 Masaaki Morishita

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.0
    72
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.3.0
    72
  • 0.2.0
    1
  • 0.1.2
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i postcss-important

Weekly Downloads

60

Version

0.3.0

License

MIT

Last publish

Collaborators

  • morishitter