Skip to content

Commit

Permalink
fix: line-clamp mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
cncolder committed Jun 8, 2020
1 parent 47a58fc commit 1e795d9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions style/mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@import '~taro-ui/dist/style/mixins';

@mixin line($num: 1) {
overflow: hidden;
text-overflow: ellipsis;

@if ($num == 1) {
white-space: nowrap;
} @else {
display: -webkit-box;
-webkit-line-clamp: $num;

// 以叹号开头的注释才能逃过 postcss-loader. https://juejin.im/post/5ce4abb0518825332550c105
/*! autoprefixer: ignore next */
-webkit-box-orient: vertical;
}
}

0 comments on commit 1e795d9

Please sign in to comment.