-webkit-box-orient: vertical; in sass is not compiled in gulp
Asked Answered
I

3

8

In sass file

h3 {
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                line-height: 24px; 
                max-height: 24px;
                -webkit-line-clamp: 1; 
                -webkit-box-orient: vertical;
            }

After running gulp task, getting in css as

 .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;
}

The style -webkit-box-orient: vertical; is missing in css file.

My gulp task for sass compilation is

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' }));
});
Imp answered 23/3, 2017 at 4:59 Comment(1)
sass version used is gulp-ruby-sass: 2.1.1Imp
T
15

Add this line of code and it will work fine:

/* autoprefixer: off */

-webkit-box-orient: vertical;

/* autoprefixer: on */
Turn answered 14/5, 2018 at 11:26 Comment(0)
U
2

Look this issus on Github.

config autoprefixer like this. Hope it can help you.

autoprefixer({
  remove: false,
  browsers: ['last 2 versions']
})
Unrighteous answered 2/4, 2017 at 11:36 Comment(0)
D
0

You can also capitalize the first letter of the prefix.
It will avoid the autoprefixer from modifying the code.

-Webkit-box-orient: vertical;

This code works because CSS is case insensitive.

Doubtless answered 7/12, 2023 at 9:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.