1.0.1 • Published 5 years ago

less-to-css-x v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

less-to-css-x

Lint and fix Less then compile to CSS.

Example

Javascript API

import lessToCss from 'less-to-css-x';

/**
 * lessToCss options.
 *
 * @typedef {!object} RenderOptions
 * @property {string} source
 * @property {string} [destination]
 * @property {(string|boolean)} [sourceMap=false]
 * @property {boolean} [minify=false]
 * @property {boolean} [dryRun=false]
 * @property {boolean} [noFix=false]
 */

// 'result' is a postcss.LazyResult
// https://api.postcss.org/LazyResult.html

lessToCss({source: '__tests__/basic.less'}).then((result) => {
  console.log(result);
});

Example

CLI

$ less-to-css-x.js --help
Usage: less-to-css-x.js [options] <source> [destination]

Options:
-h, --help        Show help                                          [boolean]
-s, --source-map  Produce a sourcemap, optionally you can set a filename
-m, --minify      Minify the output                                  [boolean]
-d, --dry-run     Execute but do not write any files                 [boolean]
-n, --no-fix      Do not perform automated fixes                     [boolean]
-v, --version     Show version number                                [boolean]

Examples:
less-to-css-x.js example.less
less-to-css-x.js example.less eg.css
less-to-css-x.js --souce-map example.less
less-to-css-x.js --souce-map=eg.css.map example.less

copyright 2019

Example

Webstorm

Alt text Alt text

Once up and running you will probably want to change 'Show console' to 'On error'.