
Product
Introducing Supply Chain Attack Campaigns Tracking in the Socket Dashboard
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.
less-css-helpers
Advanced tools
register helper functions that can be used with LESS, the same way that handlebars helpers are used in templates.
register helper functions that can be used with LESS, the same way that handlebars helpers are used in templates.
HEADS UP! This currently is not an npm module!!!! I need to come up with a different name, this is a placeholder!!!
Install with npm
$ npm i less-css-helpers --save
HEADS UP! This currently is not an npm module!!!! I need to come up with a different name, this is a placeholder!!!
var less = require('less');
var register = require('less-css-helpers')(less);
Register a single helper
Example assets helper, that might be used for dynamically calculating the path to a project's assets directory, relative to the css file's destination.
register.helper('assets', function (path) {
return 'dist/' + path.value + '/assets/css';
});
Register multiple helpers
register.helpers({
assets: function (path) {
return 'dist/' + path.value + '/assets/css';
},
foo: function () {},
bar: function () {}
});
Example of how to use the assets helper we just created above:
@theme: "blah";
@assets: assets("@{theme}");
.image {
background: url("@{assets}/bar.png");
}
Results in:
.image {
background: url("dist/blah/assets/css/bar.png");
}
The following properties are exposed on the this object:
options: Any options passed to render are exposed on this objectless: the less objectExample
register.helper('assets', function (path) {
return path.join(path.value, this.options.assets);
});
less: Leaner CSS
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on May 29, 2015.
FAQs
register helper functions that can be used with LESS, the same way that handlebars helpers are used in templates.
We found that less-css-helpers 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
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.

Security News
Node.js 25.4.0 makes require(esm) stable, formalizing CommonJS and ESM compatibility across supported Node versions.