less / Less Plugin Npm Import
Licence: apache-2.0
Allows importing from NPM packages
Stars: ✭ 71
Programming Languages
javascript
184084 projects - #8 most used programming language
DEPRECATED: Less 3+ in a Node environment will search NPM paths by default.
less-plugin-npm-import
Adds the ability for less to import from npm packages
lessc usage
Install with npm
npm install -g less-plugin-npm-import
In less file:
@import "npm://packagename/path/to/file.less";
or if importing a css file an import option is required:
@import (less) "npm://packagename/path/to/file.css";
css/less extensions not necessary
Options:
prefix - default: npm://
Command line usage
lessc --npm-import file.less file.css
lessc --npm-import="prefix=~" file.less file.css
Programmatic usage
var NpmImportPlugin = require("less-plugin-npm-import"),
options = { plugins: [new NpmImportPlugin({prefix: '~'})] };
less.render(css, options)
.then(...
Browser usage
Browser usage is not supported.
Testing
run the tests by running node test
You require the dev dependencies installed (which includes less)
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].