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
.
$ npm install postcss-annotation-include
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
:
.base-1 {
/*
* @base
*/
color: red;
}
.base-2 {
/*
* @base
*/
padding: 10px;
}
.foo {
/*
* @include .base-1, .base-2
*/
font-size: 12px;
}
You will get:
.foo {
/*
* @include .base-1, .base-2
*/
font-size: 12px;
color: red;
padding: 10px;
}
Set your original CSS file. Default parameter is root
object of PostCSS.
The flag wheather remove @base
rules. Default parameter is true
.
The MIT License (MIT)
Copyright (c) 2014 Masaaki Morishita