Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/less/less-plugin-clean-css

Post-process and compress CSS using clean-css.
https://github.com/less/less-plugin-clean-css

less-plugin

Last synced: about 2 months ago
JSON representation

Post-process and compress CSS using clean-css.

Awesome Lists containing this project

README

        


Github Actions CI
Downloads

# less-plugin-clean-css

Compresses the css output from less using [clean-css](https://github.com/jakubpawlowicz/clean-css).

## lessc usage

First of all install less via

```bash
npm install -g less
```

then install the `less-plugin-clean-css`

```bash
npm install -g less-plugin-clean-css
```

and then on the command line,

```bash
lessc file.less --clean-css="--s1 --advanced --compatibility=ie8"
```

See [clean-css](https://github.com/jakubpawlowicz/clean-css/tree/v3.0.1#how-to-use-clean-css-programmatically) for the
available command options - the only differences are `advanced` and `rebase` which we default to false, because it is
not always entirely safe.

## Programmatic usage

```js
var LessPluginCleanCSS = require('less-plugin-clean-css'),
cleanCSSPlugin = new LessPluginCleanCSS({advanced: true});
less.render(lessString, {plugins: [cleanCSSPlugin]})
.then(
```

## Browser usage

Browser usage is not supported at this time.