mixins.less
1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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
// Text truncation
.text-truncate() {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Force no line break */
.word-nowrap() {
word-wrap: normal;
white-space: nowrap;
}
/* Force line break */
.break-all() {
word-break: break-all;
word-wrap: break-word;
white-space: normal;
}
// Prohibit selection
.unselect() {
cursor: pointer;
user-select: none;
}
/* Suitable for webkit core and mobile */
.ellipsis-multiple(@num: 1) {
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: @num;
}
.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();
}
}
.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();
}
}