-webkit-box-orient:垂直; 在sass中没有编译成gulp

Sha*_* KP 3 css sass gulp

在sass文件中

h3 {
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                line-height: 24px; 
                max-height: 24px;
                -webkit-line-clamp: 1; 
                -webkit-box-orient: vertical;
            }
Run Code Online (Sandbox Code Playgroud)

运行gulp任务后,进入css为

 .article-list.search .article-listings__item h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  line-height: 24px;
  max-height: 24px;
  -webkit-line-clamp: 1;
}
Run Code Online (Sandbox Code Playgroud)

-webkit-box-orient: vertical;css文件中缺少样式.

我编写的sass编译任务是

gulp.task('styles', function() {
  return sass('src/assets/stylesheets/index.scss', { style: 'expanded' })
    .pipe(autoprefixer('last 2 version'))
    .pipe(gulp.dest('dist/styles'))
    .pipe(rename({ suffix: '.min' }))
    .pipe(cleanCSS())
    .pipe(gulp.dest('dist/styles'))
    .pipe(notify({ message: 'Styles task complete' }));
});
Run Code Online (Sandbox Code Playgroud)

小智 5

添加这行代码,它将正常工作:

/* autoprefixer: off */

-webkit-box-orient: vertical;

/* autoprefixer: on */
Run Code Online (Sandbox Code Playgroud)


小智 2

在Github上查看这个问题。

像这样配置自动前缀。希望它可以帮助你。

autoprefixer({
  remove: false,
  browsers: ['last 2 versions']
})
Run Code Online (Sandbox Code Playgroud)