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.
- Host: GitHub
- URL: https://github.com/less/less-plugin-clean-css
- Owner: less
- License: apache-2.0
- Created: 2014-09-09T20:31:01.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-02-20T11:45:28.000Z (3 months ago)
- Last Synced: 2025-04-06T00:05:30.978Z (2 months ago)
- Topics: less-plugin
- Language: JavaScript
- Homepage: http://lesscss.org
- Size: 92.8 KB
- Stars: 192
- Watchers: 16
- Forks: 41
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.