Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/sindresorhus/gulp-autoprefixer

Prefix CSS
https://github.com/sindresorhus/gulp-autoprefixer

autoprefixer css gulp-plugin javascript nodejs postcss prefix-css

Last synced: about 1 month ago
JSON representation

Prefix CSS

Awesome Lists containing this project

README

        

# gulp-autoprefixer

> Prefix CSS with [Autoprefixer](https://github.com/postcss/autoprefixer)

*Issues with the output should be reported on the Autoprefixer [issue tracker](https://github.com/postcss/autoprefixer/issues).*

## Install

```sh
npm install --save-dev gulp-autoprefixer
```

## Usage

```js
import gulp from 'gulp';
import autoprefixer from 'gulp-autoprefixer';

export default () => (
gulp.src('src/app.css')
.pipe(autoprefixer({
cascade: false
}))
.pipe(gulp.dest('dist'))
);
```

## API

### autoprefixer(options?)

#### options

Type: `object`

See the Autoprefixer [options](https://github.com/postcss/autoprefixer#options).

## Source Maps

Use [gulp-sourcemaps](https://github.com/gulp-sourcemaps/gulp-sourcemaps) like this:

```js
import gulp from 'gulp';
import sourcemaps from 'gulp-sourcemaps';
import concat from 'gulp-concat';
import autoprefixer from 'gulp-autoprefixer';

export default () => (
gulp.src('src/**/*.css')
.pipe(sourcemaps.init())
.pipe(autoprefixer())
.pipe(concat('all.css'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'))
);
```

## Tip

If you use other PostCSS based tools, like `cssnano`, you may want to run them together using [`gulp-postcss`](https://github.com/postcss/autoprefixer#gulp) instead of `gulp-autoprefixer`. It will be faster, as the CSS is parsed only once for all PostCSS based tools, including Autoprefixer.