/
utils.less
123 lines (104 loc) · 3.14 KB
/
utils.less
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* Parametric Mixins for vendor-specific properties, with sensible defaults */
.border-radius (@radius: 5px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
.box-sizing(@type: border-box) {
-webkit-box-sizing: @type;
-moz-box-sizing: @type;
-ms-box-sizing: @type;
box-sizing: @type;
}
.border-radius-each(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) {
-webkit-border-top-right-radius: @topright;
-webkit-border-bottom-right-radius: @bottomright;
-webkit-border-bottom-left-radius: @bottomleft;
-webkit-border-top-left-radius: @topleft;
-moz-border-radius-topright: @topright;
-moz-border-radius-bottomright: @bottomright;
-moz-border-radius-bottomleft: @bottomleft;
-moz-border-radius-topleft: @topleft;
border-top-right-radius: @topright;
border-bottom-right-radius: @bottomright;
border-bottom-left-radius: @bottomleft;
border-top-left-radius: @topleft;
-moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;
}
.box-shadow(@shadow: 1px 1px 2px rgba(0, 0, 0, 0.25)) {
-webkit-box-shadow: @shadow;
-moz-box-shadow: @shadow;
box-shadow: @shadow;
}
.inner-shadow(@horizontal: 0, @vertical: 1px, @blur: 2px, @spread: 0, @color: rgba(0, 0, 0, 0.3)) {
-webkit-box-shadow: inset @arguments;
-moz-box-shadow: inset @arguments;
box-shadow: inset @arguments;
}
.text-shadow(@x: 1px, @y: 1px, @blur: 2px, @color: #666) {
text-shadow: @arguments;
}
.gradient(@start: #EEE, @stop: #FFF) {
background: @stop;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, @start), color-stop(1, @stop));
background: -moz-linear-gradient(center top, @start 0%, @stop 100%);
background: -ms-linear-gradient(top, @start, @stop);
}
.opacity(@opacity: 0.5) {
-webkit-opacity: @opacity;
-khtml-opacity: @opacity;
-moz-opacity: @opacity;
opacity: @opacity;
@opperc: @opacity * 100;
-ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc})";
filter: ~"alpha(opacity=@{opperc})";
}
.transition(@transition) {
-webkit-transition: @transition;
-moz-transition: @transition;
transition: @transition;
}
.transform-origin (@arguments) {
-webkit-transform-origin: @arguments;
-moz-transform-origin: @arguments;
-ms-transform-origin: @arguments;
-o-transform-origin: @arguments;
transform-origin: @arguments;
}
.transform (@arguments) {
-webkit-transform: @arguments;
-moz-transform: @arguments;
-ms-transform: @arguments;
-o-transform: @arguments;
transform: @arguments;
}
.filter(@filter: grayscale(100%)) {
-webkit-filter: @filter;
-moz-filter: @filter;
-ms-filter: @filter;
-o-filter: @filter;
filter: @filter;
}
/* Miscellaneous Utility Styles */
.hidden {
display: none !important;
}
.align-center {
text-align: center;
}
.align-left {
text-align: left;
}
.align-right {
text-align: right;
}
.clearfix {
&:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
}