https://github.com/matype/postcss-annotation-include
PostCSS plugin for annotations based including properties in other rule sets
https://github.com/matype/postcss-annotation-include
Last synced: 9 months ago
JSON representation
PostCSS plugin for annotations based including properties in other rule sets
- Host: GitHub
- URL: https://github.com/matype/postcss-annotation-include
- Owner: matype
- License: other
- Created: 2014-12-13T02:13:42.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-16T11:15:46.000Z (almost 11 years ago)
- Last Synced: 2025-10-06T01:47:43.401Z (10 months ago)
- Language: JavaScript
- Size: 216 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.markdown
- License: LICENSE
Awesome Lists containing this project
README
# postcss-annotation-include [](https://travis-ci.org/morishitter/postcss-annotation-include)
PostCSS plugin for annotations based including properties in other rule sets.
Using this plugin, can use inline expanding property declarations of other rules by `@include`.
## Installation
```shell
$ npm install postcss-annotation-include
```
## Example
```js
var fs = require('fs')
var postcss = require('postcss')
var include = require('postcss-annotation-include')
var css = fs.readFileSync('input.css', 'utf-8')
var output = postcss(css)
.use(include())
.process(css)
.css
```
Using this `input.css`:
```css
.base-1 {
/*
* @base
*/
color: red;
}
.base-2 {
/*
* @base
*/
padding: 10px;
}
.foo {
/*
* @include .base-1, .base-2
*/
font-size: 12px;
}
```
You will get:
```css
.foo {
/*
* @include .base-1, .base-2
*/
font-size: 12px;
color: red;
padding: 10px;
}
```
## Options
### `options.css`
Set your original CSS file. Default parameter is `root` object of PostCSS.
### `options.removeBase`
The flag wheather remove `@base` rules. Default parameter is `true`.
## License
The MIT License (MIT)
Copyright (c) 2014 Masaaki Morishita