Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 days ago
JSON representation
Prefix CSS
- Host: GitHub
- URL: https://github.com/sindresorhus/gulp-autoprefixer
- Owner: sindresorhus
- License: mit
- Created: 2014-09-08T15:51:24.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2023-11-02T16:52:28.000Z (about 1 year ago)
- Last Synced: 2024-10-29T15:18:28.260Z (3 months ago)
- Topics: autoprefixer, css, gulp-plugin, javascript, nodejs, postcss, prefix-css
- Language: JavaScript
- Size: 39.1 KB
- Stars: 694
- Watchers: 25
- Forks: 50
- Open Issues: 7
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
- Security: .github/security.md
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.