sass常用的mixin

单行溢出省略

@mixin sln() {

​ overflow: hidden;

​ text-overflow: ellipsis;

​ white-space: nowrap;

}

多行溢出

@mixin mln($line:2, $lh:null) {

​ overflow: hidden;

​ text-overflow: ellipsis;

​ display: -webkit-box;

​ -webkit-box-orient: vertical;

​ -webkit-line-clamp: $line;

​ @if ($lh) {

​ height: $line*$lh;

​ line-height: $lh;

​ }

}