mixins.less 2.2 KB
Newer Older
陈文彬 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
.setPlaceholder(@prefix,@color:@text-color-help-dark) {
  // input
  @{prefix}::-webkit-input-placeholder {
    color: @color;
  }
  @{prefix}::-moz-placeholder {
    /* Mozilla Firefox 19+ */
    color: @color;
  }
  @{prefix}:-moz-placeholder {
    /* Mozilla Firefox 4 to 18 */
    color: @color;
  }
  @{prefix}:-ms-input-placeholder {
    /* Internet Explorer 10-11 */
    color: @color;
  }
}
V
vben 已提交
19
// Text truncation
陈文彬 已提交
20 21 22 23 24 25
.text-truncate() {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

V
vben 已提交
26
/* Force no line break */
陈文彬 已提交
27 28 29 30 31
.word-nowrap() {
  word-wrap: normal;
  white-space: nowrap;
}

V
vben 已提交
32
/* Force line break */
陈文彬 已提交
33 34 35 36 37 38
.break-all() {
  word-break: break-all;
  word-wrap: break-word;
  white-space: normal;
}

V
vben 已提交
39
// Prohibit selection
陈文彬 已提交
40 41 42 43 44
.unselect() {
  cursor: pointer;
  user-select: none;
}

V
vben 已提交
45
/* Suitable for webkit core and mobile */
陈文彬 已提交
46 47 48 49 50 51
.ellipsis-multiple(@num: 1) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: @num;
}
N
nebv 已提交
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92

.respond-to (small, @content) {
  @media only screen and (min-width: @screen-sm-min) {
    @content();
  }
}
.respond-to (medium, @content) {
  @media only screen and (min-width: @screen-md-min) {
    @content();
  }
}
.respond-to (large, @content) {
  @media only screen and (min-width: @screen-lg-min) {
    @content();
  }
}
.respond-to (xlarge, @content) {
  @media only screen and (min-width: @screen-xl-min) {
    @content();
  }
}
.respond-to (xsmall-only, @content) {
  @media only screen and (max-width: @screen-xs-max) {
    @content();
  }
}
.respond-to (small-only, @content) {
  @media only screen and (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
    @content();
  }
}
.respond-to (medium-only, @content) {
  @media only screen and (min-width: @screen-md-min) and (max-width: @screen-md-max) {
    @content();
  }
}
.respond-to (large-only, @content) {
  @media only screen and (min-width: @screen-lg-min) and (max-width: @screen-lg-max) {
    @content();
  }
}
V
vben 已提交
93

N
nebv 已提交
94 95 96 97 98 99 100 101 102 103
.respond-to (xsmall-and-small, @content) {
  @media only screen and (max-width: @screen-sm-max) {
    @content();
  }
}
.respond-to (small-and-medium, @content) {
  @media only screen and (min-width: @screen-sm-min) and (max-width: @screen-md-max) {
    @content();
  }
}