Skip to content

Commit

Permalink
mixins: Add line-clamp() and text-ellpsis()
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Aug 8, 2023
1 parent 822c4c7 commit af32723
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions asset/css/mixin/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,25 @@
-moz-box-shadow: @arguments;
box-shadow: @arguments;
}

.line-clamp(@numOfLines: 2) when (@numOfLines > 1) {
display: -webkit-box;
-webkit-line-clamp: @numOfLines;
-webkit-box-orient: vertical;
}
.line-clamp(@numOfLines: 2) when (@numOfLines = "reset") {
display: revert;
-webkit-line-clamp: initial;
-webkit-box-orient: initial;
}

.text-ellipsis() {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.text-ellipsis-multiline() {
overflow: hidden;
text-overflow: ellipsis;
}

0 comments on commit af32723

Please sign in to comment.