# gulp-csso

> Minify CSS with CSSO.

Latest version **4.0.1** (published 2019-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-csso
pnpm add gulp-csso
yarn add gulp-csso
bun add gulp-csso
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2019-11-14 |
| First published | 2013-12-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/gulp-csso) |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 3 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 239 |
| Author | Ben Briggs |
| Maintainers | beneb, lahmatiy |
| Keywords | gulpplugin, minify, css |

## Links

- npm: https://www.npmjs.com/package/gulp-csso
- Repository: https://github.com/ben-eb/gulp-csso
- Issues: https://github.com/ben-eb/gulp-csso/issues
- npm.io page: https://npm.io/package/gulp-csso

## Dependencies (3)

- [csso](https://npm.io/package/csso.md) ^4.0.0
- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.0
- [vinyl-sourcemaps-apply](https://npm.io/package/vinyl-sourcemaps-apply.md) ^0.2.1

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 4.0.1 (latest) — 2019-11-14
- 4.0.0 — 2019-11-14
- 3.0.1 — 2018-01-05
- 3.0.0 — 2017-03-14
- 2.0.0 — 2016-04-09
- 1.1.0 — 2016-03-01
- 1.0.1 — 2015-10-17
- 1.0.0 — 2015-01-28
- 0.2.9 — 2014-06-02
- 0.2.8 — 2014-04-21
- 0.2.7 — 2014-04-04
- 0.2.6 — 2014-02-24
- 0.2.5 — 2014-02-23
- 0.2.4 — 2014-02-20
- 0.2.3 — 2014-01-28
- … 12 more at https://npm.io/package/gulp-csso/versions

## README

# [gulp](https://github.com/gulpjs/gulp)-csso [![Build Status](https://travis-ci.org/ben-eb/gulp-csso.svg?branch=master)](https://travis-ci.org/ben-eb/gulp-csso) [![NPM version](https://badge.fury.io/js/gulp-csso.svg)](http://badge.fury.io/js/gulp-csso) [![Dependency Status](https://gemnasium.com/ben-eb/gulp-csso.svg)](https://gemnasium.com/ben-eb/gulp-csso)

> Minify CSS with [CSSO](https://www.npmjs.com/package/csso).

*If you have any difficulties with the output of this plugin, please use
the [CSSO tracker](https://github.com/css/csso/issues).*

## Install

With [npm](https://www.npmjs.com/package/gulp-csso) do:

```
npm install gulp-csso --save-dev
```

## Example

```js
var gulp = require('gulp');
var csso = require('gulp-csso');

gulp.task('default', function () {
    return gulp.src('./main.css')
        .pipe(csso())
        .pipe(gulp.dest('./out'));
});

gulp.task('development', function () {
    return gulp.src('./main.css')
        .pipe(csso({
            restructure: false,
            sourceMap: true,
            debug: true
        }))
        .pipe(gulp.dest('./out'));
});
```

## API

### csso([options])

#### options

For backwards compatibility it can also be a `boolean`. In this case, the
inverted value is set to `options.restructure`
(e.g. `true` becomes `{restructure: false}`).

##### restructure

Type: `boolean`  
Default: `true`

The default is to use structure minimization for maximum compression.
Pass `false` instead if you want to disable this feature.

##### sourceMap

Type: `boolean`  
Default: depends on input file has a source map or not

Specify this to generate source map; by default a source map is generated only
if the input file has a source map. Pass `true` to ensure that the source map
is generated or `false` to disable this.

Alternatively, you can enable source maps support using [gulp-sourcemaps]:

[gulp-sourcemaps]: https://github.com/floridoo/gulp-sourcemaps

```js
var gulp = require('gulp');
var csso = require('gulp-csso');
var sourcemaps = require('gulp-sourcemaps');

gulp.task('default', function () {
    return gulp.src('main.css')
        .pipe(sourcemaps.init())
        .pipe(csso())
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('./out'));
});
```

##### debug

Type: `boolean`  
Default: `false`

Pass `true` or a positive number (greater number for more details) to get some
debugging information about the minification process.

##### usage

Type: `object`
Default: `null`

Usage data for advanced optimisations (read more in the [CSSO documentation](https://github.com/css/csso#usage-data)).

## Contributing

Pull requests are welcome. If you add functionality, then please add unit tests
to cover it.

## License

MIT © [Ben Briggs](http://beneb.info)

---
_Source: https://npm.io/package/gulp-csso · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
