gulp autoprefixer doesn't add moz prefix

丶灬走出姿态 提交于 2019-12-05 07:49:00

Use "autoprefixer-core" with "gulp-postcss". Usage example :

var MASK_SRC = "./src/mask/page0/";

var gulp = require("gulp")
var plumber = require("gulp-plumber")
var postcss = require('gulp-postcss');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('autoprefixer-core');
var csso = require("gulp-csso")

gulp.task("styles", function() {
    return gulp.src(MASK_SRC + "scss/*.css")
    //.pipe(plumber())
    .pipe(postcss([ autoprefixer({ browsers: ["> 0%"] }) ]))
    //.pipe(csso())
    .pipe(gulp.dest(MASK_SRC + "/css/"))
})

gulp.task("dev", ["styles"], function() {
  gulp.watch(MASK_SRC + "scss/**/*", function(event) {
    gulp.run("styles")
  })
})

If you check http://caniuse.com/#search=linear-gradient, you will see that Firefox since at least version 30 do not require the moz- prefix. Version version 30 has a global market share of < 1% and you have set '> 1%'

There is a bug with gulp-autprefixer.No way to add "-moz-" prefix.

Autoprefixer standalone works well: http://jsfiddle.net/tsvppawk/

The same query "Firefox >= 2" in gulp-atuprefixer generates:

background: -webkit-linear-gradient(#e98a00, #f5aa2f);
background: linear-gradient(#e98a00, #f5aa2f);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!