https://github.com/matype/postcss-important
PostCSS plugin for annotations based `!important`
https://github.com/matype/postcss-important
Last synced: about 1 year ago
JSON representation
PostCSS plugin for annotations based `!important`
- Host: GitHub
- URL: https://github.com/matype/postcss-important
- Owner: matype
- License: other
- Created: 2014-12-13T00:44:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-17T01:55:00.000Z (almost 11 years ago)
- Last Synced: 2025-05-24T08:46:49.289Z (about 1 year ago)
- Language: JavaScript
- Size: 185 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.markdown
- License: LICENSE
Awesome Lists containing this project
README
# postcss-important [](https://travis-ci.org/morishitter/postcss-important)
PostCSS plugin for annotations based `!important`
## Installation
```shell
$ npm install postcss-important
```
## Example
```js
// 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`:
```css
.foo {
/* @important */
font-size: 12px !important;
color: red;
}
.bar {
/*
* @important color, padding
*/
color: red;
font-size: 12px;
padding: 10px;
}
```
You will get:
```css
.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