Browse Source

style: feat moreline

richard1015 4 years ago
parent
commit
4eeb0fd9fb
1 changed files with 15 additions and 0 deletions
  1. 15 0
      src/styles/mixins/text-ellipsis.scss

+ 15 - 0
src/styles/mixins/text-ellipsis.scss

@@ -3,3 +3,18 @@
   overflow: hidden;
   text-overflow: ellipsis;
 }
+// 单行超长省略号
+@mixin oneline-ellipsis($width: 100%) {
+  width: $width;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+// 多行超长省略号
+@mixin moreline-ellipsis($line: 2, $width: 100%) {
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: $line;
+  overflow: hidden;
+  word-break: break-all;
+}