
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
postcss-less-parser
Advanced tools
PostCSS plugin for integrating the popular Less CSS pre-processor into your PostCSS workflow
The PostCSS plugin you've been waiting for: a PostCSS custom parser plugin for integrating the popular Less.js CSS pre-processor into your PostCSS workflow! It integrates the entire Less engine, evaluates your .less
, and exports a PostCSS AST that you can use to attach multiple subsequent PostCSS plugins.
Instead of trying to assemble a hodge-podge collection of PostCSS plugins that "emulate" a pre-processor, use a pre-processor!
THAT'S RIGHT. This plugin doesn't give you "Less-like" functionality, or "Less-like" parsing. It gives you the full awesomeness of Less, with the flexibility of PostCSS. Basically, you can throw your "pre-processor-y" plugins away now.
less()
plugin needs to be the first plugin called.Follow these simple steps to use postcss-less-parser.
Add postcss-less-parser to your build tool:
npm install postcss-less-parser --save-dev
var less = require('postcss-less-parser');
less({ /* Less.js options */ }).process(YOUR_CSS, { parser: less.parser });
Load postcss-less-parser as a PostCSS plugin:
var less = require('postcss-less-parser');
postcss([
less({ /* Less.js options */ })
]).process(YOUR_CSS, { parser: less.parser }).then(function (result) {
// do something with result.css
});
Add [Gulp PostCSS] to your build tool:
npm install gulp-postcss --save-dev
Enable postcss-less-parser within your Gulpfile:
var postcss = require('gulp-postcss');
gulp.task('less', function () {
return gulp.src('./css/src/style.less').pipe(
postcss([
require('postcss-less-parser')({ /* Less.js options */ })
])
).pipe(
gulp.dest('./css')
);
});
Add [Grunt PostCSS] to your build tool:
npm install postcss-less-parser --save-dev
Enable postcss-less-parser within your Gruntfile:
grunt.loadNpmTasks('grunt-postcss');
grunt.initConfig({
postcss: {
options: {
parser: require('postcss-less-parser'),
processors: [
require('postcss-less-parser')({ /* Less.js options */ })
]
},
dist: {
src: 'css/*.css'
}
}
});
FAQs
PostCSS plugin for integrating the popular Less CSS pre-processor into your PostCSS workflow
The npm package postcss-less-parser receives a total of 7 weekly downloads. As such, postcss-less-parser popularity was classified as not popular.
We found that postcss-less-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.