Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webkit box orient styling disappears from styling

In my Angular app (I'm on version 4.3.1) I'm adding a CSS ellipsis after multiple lines.
For this, I use the following css code in Sass.

.ellipsis {     -webkit-box-orient: vertical;     display: block;     display: -webkit-box;     -webkit-line-clamp: 2;     overflow: hidden;     text-overflow: ellipsis; } 

For some reason, the box-orient line simply gets removed from the styling by the transpile, causing the ellipsis to not work. This seems to happen in Angular and Ionic apps.

like image 417
Paul van den Dool Avatar asked Sep 11 '17 09:09

Paul van den Dool


People also ask

Can I use webkit box Orient?

CSS property: box-orient This feature is deprecated/obsolete and should not be used.

What can I use instead of a webkit box?

and mentioned box will be replaced with flexbox.

What is Webkit box in CSS?

The -webkit-box-reflect CSS property lets you reflect the content of an element in one specific direction.


1 Answers

Wrapping -webkit-box-orient in the following autoprefixer code seems to solve the issue.

.ellipsis {     display: block;     display: -webkit-box;     -webkit-line-clamp: 2;     overflow: hidden;     text-overflow: ellipsis;     -webkit-box-orient: vertical;     /* autoprefixer: off */ } 
like image 185
Paul van den Dool Avatar answered Sep 22 '22 11:09

Paul van den Dool