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 79c08ff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions asset/css/mixin/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,20 @@
-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;
}

0 comments on commit 79c08ff

Please sign in to comment.