55 More info at: http://lesselements.com
66 ---------------------------------------------------
77
8- - Gradient background
9- - Drop shadow
10- - Inner shadow
11- - Rounded
12- - Border radius
13- - Opacity
148 - Transition
15- - Transition duration
169 - Rotation
17- - Scale
18- - Translate
1910 - Box sizing
2011
2112 */
2213
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-
13414/* - Transition
13515 *
13616 * Sets the transition duration and effect to use for any
13919 */
14020
14121.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 ;
14522 transition : all @duration @ease ;
14623}
14724
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-
17225/* - Rotation
17326 *
17427 * Rotates the item by a number of degrees clockwise.
17528 */
17629
17730.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);
19932}
20033
20134/* - Boox sizing
20639 */
20740
20841.box-sizing (@sizing : border-box ) {
209- -ms-box-sizing : @sizing ;
210- -moz-box-sizing : @sizing ;
211- -webkit-box-sizing : @sizing ;
21242 box-sizing : @sizing ;
21343}
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