An open API service indexing awesome lists of open source software.

https://github.com/becklyn/kaba-shelf-less

A less shelf implementation. Integrates with kaba
https://github.com/becklyn/kaba-shelf-less

Last synced: 3 months ago
JSON representation

A less shelf implementation. Integrates with kaba

Awesome Lists containing this project

README

        

kaba-shelf-less
===============

A [kaba] shelf implementation of the [less] compiler.

Installation
------------

Just install via npm / yarn:

```bash
yarn add kaba-less
```

Usage
-----

In your `kabafile.js` use it like any other shelf task:

```js
const kaba = require("kaba");
const lessShelf = require("kaba-shelf-less");

const less = lessShelf({
/* config here */
})

kaba.task("less", less);

```

Configuration
-------------

Only files at the root of the directory are compiled.

All configuration options:

| Option | Type | Description | Default value | Comment |
| ---------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `input` | `string` | A glob that matches all directories that contain LESS files | `"src/**/Resources/assets/less/"` | As this parameter is passed unaltered to [glob] it will accept everything that glob accepts. |
| `output` | `string` | The output dir for compiled files | `"../../public/css"` | This path is relative to the (resolved) `input` path for the given file. |
| `browsers` | `array` | The list of supported browers | `["last 2 versions", "IE 10"]` | This value is passed to [autoprefixer], so please look in their documentation for all allowed values. |
| `outputFileName` | `function(string, string) : string` | Optional transform function to generate the output file name. Receives the `output` and `input` filenames as parameters. | – | The first argument is the auto-generated file name. |
| `debug` | `boolean` | Flag, whether a debug build should be generated. | if `--debug` is set `true`, `false` otherwise | |
| `watch` | `boolean` | Flag, whether a watcher should be started. | if `--debug` is set `true`, `false` otherwise | |

[kaba]: https://github.com/Becklyn/kaba
[less]: http://lesscss.org/
[glob]: https://www.npmjs.com/package/glob
[autoprefixer]: https://www.npmjs.com/package/autoprefixer