A PostCSS plugin to extend simple rules
npm install postcss-extends
a { color: blue }
a:hover { color: red }
div { extends: a }
will produce
a { color: blue }
a:hover { color: red }
div { color: blue }
div:hover { color: red }
Using Gulp.
var gulp = require('gulp'),
postcss = require('gulp-postcss'),
extends = require('postcss-extends');
gulp.task('css', function() {
gulp.src('path/to/dev/css').
.pipe(postcss({
// use it after nesting plugins
extends
}))
.pipe(gulp.dest('path/to/build/css'));
});
// rest of the gulp file