utils.less 847 Bytes
Newer Older
1 2
.textOverflow() {
  overflow: hidden;
Yu's avatar
Yu 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;
Yu's avatar
Yu 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;
Yu's avatar
Yu committed
20 21 22
    padding: 0 1px;
    background: @bg;
    content: '...';
23
  }
Yu's avatar
Yu committed
24
  &::after {
25
    position: absolute;
26
    right: 14px;
27 28
    width: 1em;
    height: 1em;
Yu's avatar
Yu committed
29 30 31
    margin-top: 0.2em;
    background: white;
    content: '';
32 33 34 35 36 37 38
  }
}

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