utils.less 847 Bytes
Newer Older
1 2
.textOverflow() {
  overflow: hidden;
陈帅's avatar
陈帅 committed
3
  white-space: nowrap;
4 5 6 7
  text-overflow: ellipsis;
  word-break: break-all;
}

niko's avatar
niko committed
8
.textOverflowMulti(@line: 3, @bg: #fff) {
9 10 11 12
  position: relative;
  max-height: @line * 1.5em;
  margin-right: -1em;
  padding-right: 1em;
陈帅's avatar
陈帅 committed
13 14 15 16
  overflow: hidden;
  line-height: 1.5em;
  text-align: justify;
  &::before {
17
    position: absolute;
niko's avatar
niko committed
18
    right: 14px;
19
    bottom: 0;
陈帅's avatar
陈帅 committed
20 21 22
    padding: 0 1px;
    background: @bg;
    content: '...';
23
  }
陈帅's avatar
陈帅 committed
24
  &::after {
25
    position: absolute;
26
    right: 14px;
27 28
    width: 1em;
    height: 1em;
陈帅's avatar
陈帅 committed
29 30 31
    margin-top: 0.2em;
    background: white;
    content: '';
32 33 34 35 36 37 38
  }
}

// mixins for clearfix
// ------------------------
.clearfix() {
  zoom: 1;
陈帅's avatar
陈帅 committed
39 40
  &::before,
  &::after {
41
    display: table;
陈帅's avatar
陈帅 committed
42
    content: ' ';
43
  }
陈帅's avatar
陈帅 committed
44
  &::after {
45 46
    clear: both;
    height: 0;
陈帅's avatar
陈帅 committed
47 48
    font-size: 0;
    visibility: hidden;
49 50
  }
}