OLD | NEW |
| (Empty) |
1 //--------------------------------------------------- | |
2 // LESS Elements 0.9 | |
3 //--------------------------------------------------- | |
4 // A set of useful LESS mixins | |
5 // More info at: http://lesselements.com | |
6 //--------------------------------------------------- | |
7 | |
8 .gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) { | |
9 background: @color; | |
10 background: -webkit-gradient(linear, | |
11 left bottom, | |
12 left top, | |
13 color-stop(0, @start), | |
14 color-stop(1, @stop)); | |
15 background: -ms-linear-gradient(bottom, | |
16 @start, | |
17 @stop); | |
18 background: -moz-linear-gradient(center bottom, | |
19 @start 0%, | |
20 @stop 100%); | |
21 background: -o-linear-gradient(@stop, | |
22 @start); | |
23 filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', en
dColorstr='%d', GradientType=0)",@stop,@start)); | |
24 } | |
25 .bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) { | |
26 background: @color; | |
27 background: -webkit-gradient(linear, | |
28 left bottom, | |
29 left top, | |
30 color-stop(0, rgb(@start,@start,@start)), | |
31 color-stop(1, rgb(@stop,@stop,@stop))); | |
32 background: -ms-linear-gradient(bottom, | |
33 rgb(@start,@start,@start) 0%, | |
34 rgb(@stop,@stop,@stop) 100%); | |
35 background: -moz-linear-gradient(center bottom, | |
36 rgb(@start,@start,@start) 0%, | |
37 rgb(@stop,@stop,@stop) 100%); | |
38 background: -o-linear-gradient(rgb(@stop,@stop,@stop), | |
39 rgb(@start,@start,@start)); | |
40 filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', en
dColorstr='%d', GradientType=0)",rgb(@stop,@stop,@stop),rgb(@start,@start,@start
))); | |
41 } | |
42 .bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color
: #EEE) { | |
43 border-top: solid 1px @top-color; | |
44 border-left: solid 1px @left-color; | |
45 border-right: solid 1px @right-color; | |
46 border-bottom: solid 1px @bottom-color; | |
47 } | |
48 .drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) { | |
49 -webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha); | |
50 -moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha); | |
51 box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha); | |
52 } | |
53 .rounded(@radius: 2px) { | |
54 -webkit-border-radius: @radius; | |
55 -moz-border-radius: @radius; | |
56 border-radius: @radius; | |
57 } | |
58 .border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) { | |
59 -webkit-border-top-right-radius: @topright; | |
60 -webkit-border-bottom-right-radius: @bottomright; | |
61 -webkit-border-bottom-left-radius: @bottomleft; | |
62 -webkit-border-top-left-radius: @topleft; | |
63 -moz-border-radius-topright: @topright; | |
64 -moz-border-radius-bottomright: @bottomright; | |
65 -moz-border-radius-bottomleft: @bottomleft; | |
66 -moz-border-radius-topleft: @topleft; | |
67 border-top-right-radius: @topright; | |
68 border-bottom-right-radius: @bottomright; | |
69 border-bottom-left-radius: @bottomleft; | |
70 border-top-left-radius: @topleft; | |
71 .background-clip(padding-box); | |
72 } | |
73 .opacity(@opacity: 0.5) { | |
74 -moz-opacity: @opacity; | |
75 -khtml-opacity: @opacity; | |
76 -webkit-opacity: @opacity; | |
77 opacity: @opacity; | |
78 @opperc: @opacity * 100; | |
79 -ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc})"; | |
80 filter: ~"alpha(opacity=@{opperc})"; | |
81 } | |
82 .transition-duration(@duration: 0.2s) { | |
83 -moz-transition-duration: @duration; | |
84 -webkit-transition-duration: @duration; | |
85 -o-transition-duration: @duration; | |
86 transition-duration: @duration; | |
87 } | |
88 .transform(...) { | |
89 -webkit-transform: @arguments; | |
90 -moz-transform: @arguments; | |
91 -o-transform: @arguments; | |
92 -ms-transform: @arguments; | |
93 transform: @arguments; | |
94 } | |
95 .rotation(@deg:5deg){ | |
96 .transform(rotate(@deg)); | |
97 } | |
98 .scale(@ratio:1.5){ | |
99 .transform(scale(@ratio)); | |
100 } | |
101 .transition(@duration:0.2s, @ease:ease-out) { | |
102 -webkit-transition: all @duration @ease; | |
103 -moz-transition: all @duration @ease; | |
104 -o-transition: all @duration @ease; | |
105 transition: all @duration @ease; | |
106 } | |
107 .inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) { | |
108 -webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha); | |
109 -moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha); | |
110 box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha); | |
111 } | |
112 .box-shadow(@arguments) { | |
113 -webkit-box-shadow: @arguments; | |
114 -moz-box-shadow: @arguments; | |
115 box-shadow: @arguments; | |
116 } | |
117 .box-sizing(@sizing: border-box) { | |
118 -ms-box-sizing: @sizing; | |
119 -moz-box-sizing: @sizing; | |
120 -webkit-box-sizing: @sizing; | |
121 box-sizing: @sizing; | |
122 } | |
123 .user-select(@argument: none) { | |
124 -webkit-user-select: @argument; | |
125 -moz-user-select: @argument; | |
126 -ms-user-select: @argument; | |
127 user-select: @argument; | |
128 } | |
129 .columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE,
@columnRuleStyle: solid, @columnRuleWidth: 1px) { | |
130 -moz-column-width: @colwidth; | |
131 -moz-column-count: @colcount; | |
132 -moz-column-gap: @colgap; | |
133 -moz-column-rule-color: @columnRuleColor; | |
134 -moz-column-rule-style: @columnRuleStyle; | |
135 -moz-column-rule-width: @columnRuleWidth; | |
136 -webkit-column-width: @colwidth; | |
137 -webkit-column-count: @colcount; | |
138 -webkit-column-gap: @colgap; | |
139 -webkit-column-rule-color: @columnRuleColor; | |
140 -webkit-column-rule-style: @columnRuleStyle; | |
141 -webkit-column-rule-width: @columnRuleWidth; | |
142 column-width: @colwidth; | |
143 column-count: @colcount; | |
144 column-gap: @colgap; | |
145 column-rule-color: @columnRuleColor; | |
146 column-rule-style: @columnRuleStyle; | |
147 column-rule-width: @columnRuleWidth; | |
148 } | |
149 .translate(@x:0, @y:0) { | |
150 .transform(translate(@x, @y)); | |
151 } | |
152 .background-clip(@argument: padding-box) { | |
153 -moz-background-clip: @argument; | |
154 -webkit-background-clip: @argument; | |
155 background-clip: @argument; | |
156 } | |
OLD | NEW |