5
5
More info at: http://lesselements.com
6
6
---------------------------------------------------
7
7
8
- - Gradient background
9
- - Drop shadow
10
- - Inner shadow
11
- - Rounded
12
- - Border radius
13
- - Opacity
14
8
- Transition
15
- - Transition duration
16
9
- Rotation
17
- - Scale
18
- - Translate
19
10
- Box sizing
20
11
21
12
*/
22
13
23
- /* - Gradient background
24
- *
25
- * First color is the background color to use for browsers
26
- * that don't support gradients. The second two colors are
27
- * the start and stop colors, going from bottom to top.
28
- */
29
-
30
- .gradient (@color : #F5F5F5 , @start : #EEE , @stop : #FFF ) {
31
- background : @color ;
32
- background : -webkit-gradient (linear ,
33
- left bottom ,
34
- left top ,
35
- color - stop(0 , @start ),
36
- color - stop(1 , @stop ));
37
- background : -ms-linear-gradient (bottom ,
38
- @start ,
39
- @stop );
40
- background : -moz-linear-gradient (center bottom ,
41
- @start 0% ,
42
- @stop 100% );
43
- background : -o-linear-gradient (@stop ,
44
- @start );
45
- filter : e (%(" progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)" ,@stop ,@start ));
46
- }
47
-
48
- /* - Drop shadow
49
- *
50
- * Adds a box-shadow that is a semi-transparent black. The
51
- * first two values control the x and y axis position, the
52
- * third controls blur (how big the shadow is), and the final
53
- * value is the opacity (0 is fully transparent, 1 is opaque).
54
- */
55
-
56
- .drop-shadow (@x-axis : 0 , @y-axis : 1px , @blur : 2px , @alpha : 0.1 ) {
57
- -webkit-box-shadow : @x-axis @y-axis @blur rgba (0 , 0 , 0 , @alpha );
58
- -moz-box-shadow : @x-axis @y-axis @blur rgba (0 , 0 , 0 , @alpha );
59
- box-shadow : @x-axis @y-axis @blur rgba (0 , 0 , 0 , @alpha );
60
- }
61
-
62
- /* - Inner shadow
63
- *
64
- * Sets the inner shadow. The first two numbers are the x and y
65
- * coordinates, the third is the blur and the last one is the
66
- * strength of the shadow.
67
- */
68
-
69
- .inner-shadow (@horizontal :0 , @vertical :1px , @blur :2px , @alpha : 0.4 ) {
70
- -webkit-box-shadow : inset @horizontal @vertical @blur rgba (0 , 0 , 0 , @alpha );
71
- -moz-box-shadow : inset @horizontal @vertical @blur rgba (0 , 0 , 0 , @alpha );
72
- box-shadow : inset @horizontal @vertical @blur rgba (0 , 0 , 0 , @alpha );
73
- }
74
-
75
- /* - Box shadow
76
- */
77
-
78
- .box-shadow (@arguments ) {
79
- -webkit-box-shadow : @arguments ;
80
- -moz-box-shadow : @arguments ;
81
- box-shadow : @arguments ;
82
- }
83
-
84
- /* - Rounded
85
- *
86
- * Sets a border-radius for all 4 corners. If you want to set
87
- * border-radius for individual corners use: .border-radius
88
- */
89
-
90
- .rounded (@radius : 2px ) {
91
- -webkit-border-radius : @radius ;
92
- -moz-border-radius : @radius ;
93
- border-radius : @radius ;
94
- }
95
-
96
- /* - Border radius
97
- *
98
- * Sets a border-radius for each of the 4 corners individually.
99
- * The values go in a clockwise rotation: top right, bottom right,
100
- * bottom left, top left.
101
- */
102
-
103
- .border-radius (@topright : 0 , @bottomright : 0 , @bottomleft : 0 , @topleft : 0 ) {
104
- -webkit-border-top-right-radius : @topright ;
105
- -webkit-border-bottom-right-radius : @bottomright ;
106
- -webkit-border-bottom-left-radius : @bottomleft ;
107
- -webkit-border-top-left-radius : @topleft ;
108
- -moz-border-radius-topright : @topright ;
109
- -moz-border-radius-bottomright : @bottomright ;
110
- -moz-border-radius-bottomleft : @bottomleft ;
111
- -moz-border-radius-topleft : @topleft ;
112
- border-top-right-radius : @topright ;
113
- border-bottom-right-radius : @bottomright ;
114
- border-bottom-left-radius : @bottomleft ;
115
- border-top-left-radius : @topleft ;
116
- .background-clip (padding-box );
117
- }
118
-
119
- /* - Opacity
120
- *
121
- * Sets the opacity. 0 is fully transparent, 1 is opaque.
122
- */
123
-
124
- .opacity (@opacity : 0.5 ) {
125
- -moz-opacity : @opacity ;
126
- -khtml-opacity : @opacity ;
127
- -webkit-opacity : @opacity ;
128
- opacity : @opacity ;
129
- @opperc : @opacity * 100 ;
130
- -ms-filter : ~ " progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc} )" ;
131
- filter : ~ " alpha(opacity=@{opperc} )" ;
132
- }
133
-
134
14
/* - Transition
135
15
*
136
16
* Sets the transition duration and effect to use for any
139
19
*/
140
20
141
21
.transition (@duration :0.2s , @ease :ease-out ) {
142
- -webkit-transition : all @duration @ease ;
143
- -moz-transition : all @duration @ease ;
144
- -o-transition : all @duration @ease ;
145
22
transition : all @duration @ease ;
146
23
}
147
24
148
- /* - Transition duration
149
- *
150
- * Sets a transition-duration (time it takes to do things like
151
- * hover effects). The value provides a time in seconds.
152
- */
153
-
154
- .transition-duration (@duration : 0.2s ) {
155
- -moz-transition-duration : @duration ;
156
- -webkit-transition-duration : @duration ;
157
- -o-transition-duration : @duration ;
158
- transition-duration : @duration ;
159
- }
160
-
161
- /* - Transform
162
- */
163
-
164
- .transform (...) {
165
- -webkit-transform : @arguments ;
166
- -moz-transform : @arguments ;
167
- -o-transform : @arguments ;
168
- -ms-transform : @arguments ;
169
- transform : @arguments ;
170
- }
171
-
172
25
/* - Rotation
173
26
*
174
27
* Rotates the item by a number of degrees clockwise.
175
28
*/
176
29
177
30
.rotation (@deg :5deg ){
178
- .transform (rotate (@deg ));
179
- }
180
- /* - Scale
181
- *
182
- * Scales the item by the ratio provided. The example makes the
183
- * item 2 times larger.
184
- */
185
-
186
- .scale (@ratio :1.5 ){
187
- .transform (scale (@ratio ));
188
- }
189
-
190
- /* - Translate
191
- *
192
- * Translates an element using the given coordinates. The values
193
- * are x and y offset coordinates, so the above example moves the
194
- * element right 10 pixels and up 20 pixels.
195
- */
196
-
197
- .translate (@x :0 , @y :0 ) {
198
- .transform (translate (@x , @y ));
31
+ transform : rotate (@deg);
199
32
}
200
33
201
34
/* - Boox sizing
206
39
*/
207
40
208
41
.box-sizing (@sizing : border-box ) {
209
- -ms-box-sizing : @sizing ;
210
- -moz-box-sizing : @sizing ;
211
- -webkit-box-sizing : @sizing ;
212
42
box-sizing : @sizing ;
213
43
}
214
-
215
- /* - Background clip
216
- */
217
-
218
- .background-clip (@argument : padding-box ) {
219
- -moz-background-clip : @argument ;
220
- -webkit-background-clip : @argument ;
221
- background-clip : @argument ;
222
- }
0 commit comments