Less for PostCSS
PostCSS plugin for integrating the popular Less CSS pre-processor into your PostCSS workflow.
WIP - If anyone wants to help me get this working (especially tests, which haven't worked yet because of the async flow), that would be great. Pull requests welcome.
Usage
Follow these simple steps to use [postcss-less].
Add [postcss-less] to your build tool:
npm install postcss-less --save-dev
Node
var less = require('postcss-less');
less({ }).process(YOUR_CSS, { parser: less });
Load [postcss-less] as a PostCSS plugin:
var less = require('postcss-less');
postcss([
less({ })
]).process(YOUR_CSS, { parser: less }).then(function (result) {
});
Gulp
Add [Gulp PostCSS] to your build tool:
npm install gulp-postcss --save-dev
Enable [postcss-less] within your Gulpfile:
var postcss = require('gulp-postcss');
gulp.task('less', function () {
return gulp.src('./css/src/style.less').pipe(
postcss([
require('postcss-less')({ })
])
).pipe(
gulp.dest('./css')
);
});
Grunt
Add [Grunt PostCSS] to your build tool:
npm install postcss-less --save-dev
Enable [postcss-less] within your Gruntfile:
grunt.loadNpmTasks('grunt-postcss');
grunt.initConfig({
postcss: {
options: {
parser: require('postcss-less'),
processors: [
require('postcss-less')({ })
]
},
dist: {
src: 'css/*.css'
}
}
});