1 | //some file input variables |
---|
2 | @file-input-bg:#FFF; |
---|
3 | @file-input-border:#D5D5D5; |
---|
4 | @file-input-shadow:~"0 0 0 4px rgba(0,0,0,0.06)"; |
---|
5 | |
---|
6 | @file-input-hover-border:#F59942; |
---|
7 | @file-input-hover-shadow:~"0 0 0 4px rgba(245, 153, 66, 0.3)"; |
---|
8 | |
---|
9 | @file-input-btn-bg:#6FB3E0; |
---|
10 | @file-input-name-color:#888; |
---|
11 | @file-input-selected-name-color:#666; |
---|
12 | |
---|
13 | @file-input-icon-bg:#D1D1D1;//!ignore |
---|
14 | @file-input-selected-icon-bg:#EFAD62;//!ignore |
---|
15 | @file-input-selected-icon-picture-bg:#BD7A9D;//!ignore |
---|
16 | @file-input-selected-icon-film-bg:#87B87F;//!ignore |
---|
17 | @file-input-selected-icon-music-bg:#8B7AC9;//!ignore |
---|
18 | @file-input-selected-icon-archive-bg:#EFAD62;//!ignore |
---|
19 | |
---|
20 | @file-remove-bg:#FB7142; |
---|
21 | @file-multi-remove-color:#F4C0B1; |
---|
22 | @file-multi-border:#AAA; |
---|
23 | |
---|
24 | |
---|
25 | |
---|
26 | .ace-file-input { |
---|
27 | position:relative; |
---|
28 | height:38px; |
---|
29 | line-height:38px; |
---|
30 | margin-bottom:9px; |
---|
31 | |
---|
32 | input[type=file] { |
---|
33 | position:fixed; |
---|
34 | z-index:-2; |
---|
35 | .opacity(0); |
---|
36 | } |
---|
37 | |
---|
38 | |
---|
39 | .file-label { |
---|
40 | display:block; |
---|
41 | position:absolute; |
---|
42 | top:0; left:0; right:0; height:30px; |
---|
43 | |
---|
44 | background-color:@file-input-bg; |
---|
45 | border:1px solid @file-input-border; |
---|
46 | |
---|
47 | cursor:pointer; |
---|
48 | |
---|
49 | //.box-shadow(@file-input-shadow); |
---|
50 | .box-shadow(none); |
---|
51 | |
---|
52 | .transition(~"all 0.15s"); |
---|
53 | |
---|
54 | &:hover { |
---|
55 | //.box-shadow(@file-input-hover-shadow); |
---|
56 | .box-shadow(none); |
---|
57 | border-color:@file-input-hover-border; |
---|
58 | } |
---|
59 | &:before { /* the button */ |
---|
60 | display:inline-block; |
---|
61 | content:attr(data-title); |
---|
62 | |
---|
63 | position:absolute; |
---|
64 | right:0; top:0; bottom:0; padding:0 8px; |
---|
65 | line-height:24px; |
---|
66 | text-align:center; |
---|
67 | |
---|
68 | background-color:@file-input-btn-bg; |
---|
69 | color:#FFF; |
---|
70 | font-size:11px; font-weight:bold; |
---|
71 | |
---|
72 | border:2px solid #FFF; |
---|
73 | border-left-width:4px; |
---|
74 | |
---|
75 | .transition(~"all 0.3s"); |
---|
76 | } |
---|
77 | |
---|
78 | |
---|
79 | .file-name { /* the file name container */ |
---|
80 | display:inline-block; |
---|
81 | height:28px; max-width:80%; white-space:nowrap; overflow:hidden; |
---|
82 | line-height:28px; |
---|
83 | color:@file-input-name-color; |
---|
84 | font-size:13px; |
---|
85 | vertical-align: top; |
---|
86 | |
---|
87 | position:static; |
---|
88 | padding-left:30px; |
---|
89 | |
---|
90 | &:after { /* the file name */ |
---|
91 | display:inline-block; |
---|
92 | content:attr(data-title); |
---|
93 | } |
---|
94 | } |
---|
95 | &.selected { |
---|
96 | right:16px; |
---|
97 | .file-name { |
---|
98 | color:@file-input-selected-name-color; |
---|
99 | } |
---|
100 | |
---|
101 | } |
---|
102 | |
---|
103 | [class*="icon-"] { |
---|
104 | .ace-file-icon(); |
---|
105 | background-color:@file-input-icon-bg;//should be here |
---|
106 | } |
---|
107 | &.selected .file-name { |
---|
108 | [class*="icon-"] { |
---|
109 | background-color:@file-input-selected-icon-bg; |
---|
110 | } |
---|
111 | .icon-picture { |
---|
112 | background-color:@file-input-selected-icon-picture-bg; |
---|
113 | } |
---|
114 | .icon-film { |
---|
115 | background-color:@file-input-selected-icon-film-bg; |
---|
116 | } |
---|
117 | .icon-music { |
---|
118 | background-color:@file-input-selected-icon-music-bg; |
---|
119 | } |
---|
120 | .icon-archive { |
---|
121 | background-color:@file-input-selected-icon-archive-bg; |
---|
122 | } |
---|
123 | } |
---|
124 | &.hide-placeholder:before { |
---|
125 | display:none; |
---|
126 | } |
---|
127 | |
---|
128 | } |
---|
129 | |
---|
130 | a:hover{ |
---|
131 | text-decoration:none; |
---|
132 | } |
---|
133 | .remove { /* the remove button */ |
---|
134 | position:absolute; |
---|
135 | right:-8px; top:6px; |
---|
136 | display:none; |
---|
137 | |
---|
138 | width:17px; text-align:center; |
---|
139 | height:17px; line-height:15px; |
---|
140 | |
---|
141 | font-size:11px; font-weight:normal; |
---|
142 | |
---|
143 | background-color:@file-remove-bg; |
---|
144 | .border-radius(100%); |
---|
145 | color:#FFF; |
---|
146 | text-decoration:none; |
---|
147 | } |
---|
148 | .file-label.selected + .remove { |
---|
149 | display:inline-block; |
---|
150 | } |
---|
151 | |
---|
152 | |
---|
153 | |
---|
154 | } |
---|
155 | |
---|
156 | |
---|
157 | |
---|
158 | |
---|
159 | |
---|
160 | |
---|
161 | .ace-file-icon() { |
---|
162 | display:inline-block; |
---|
163 | position:absolute; |
---|
164 | left:0; top:0; bottom:0; |
---|
165 | line-height:24px; |
---|
166 | width:26px; |
---|
167 | text-align:center; |
---|
168 | |
---|
169 | font-family:FontAwesome; font-size:13px; |
---|
170 | |
---|
171 | |
---|
172 | border:2px solid #FFF; |
---|
173 | |
---|
174 | color:#FFF; |
---|
175 | |
---|
176 | .transition(~"all 0.1s"); |
---|
177 | } |
---|
178 | |
---|
179 | |
---|
180 | |
---|
181 | |
---|
182 | |
---|
183 | |
---|
184 | |
---|
185 | |
---|
186 | |
---|
187 | |
---|
188 | |
---|
189 | .ace-file-multiple { |
---|
190 | height:auto; |
---|
191 | .file-label { |
---|
192 | position:relative; |
---|
193 | height:auto; |
---|
194 | border:1px dashed @file-multi-border; |
---|
195 | border-radius:4px; |
---|
196 | text-align:center; |
---|
197 | |
---|
198 | &:before {/* the button */ |
---|
199 | display:inline-block; |
---|
200 | content:attr(data-title); |
---|
201 | |
---|
202 | position:relative; |
---|
203 | right:0; left:0; margin:12px; |
---|
204 | line-height:22px; |
---|
205 | |
---|
206 | background-color:#FFF; |
---|
207 | color:#CCC; |
---|
208 | font-size:18px; font-weight:bold; |
---|
209 | |
---|
210 | border:none; |
---|
211 | } |
---|
212 | &.selected .file-name [class*="icon-"] { |
---|
213 | .ace-file-icon(); |
---|
214 | } |
---|
215 | |
---|
216 | |
---|
217 | .file-name { |
---|
218 | position:relative; |
---|
219 | display:block; |
---|
220 | padding:0; |
---|
221 | height:auto; |
---|
222 | width:auto; max-width:100%; margin:0 4px; |
---|
223 | border-bottom:1px solid #DDD; |
---|
224 | text-align:left; |
---|
225 | |
---|
226 | &:first-child { |
---|
227 | margin-top:1px; |
---|
228 | } |
---|
229 | &:last-child { |
---|
230 | border-bottom-width:0; |
---|
231 | margin-bottom:1px; |
---|
232 | } |
---|
233 | img { |
---|
234 | padding:2px; |
---|
235 | border:1px solid #D7D7D7; |
---|
236 | background-color:#FFF; |
---|
237 | background-repeat:no-repeat; |
---|
238 | background-position: center; |
---|
239 | |
---|
240 | margin:4px 8px 4px 1px; |
---|
241 | } |
---|
242 | &:after { /* the file name */ |
---|
243 | display:none; |
---|
244 | } |
---|
245 | } |
---|
246 | &.selected .file-name:after { /* the file name */ |
---|
247 | display:inline-block; |
---|
248 | white-space:pre; |
---|
249 | } |
---|
250 | .file-name img + [class*="icon-"] , &.selected .file-name img + [class*="icon-"] { |
---|
251 | display:none; |
---|
252 | } |
---|
253 | |
---|
254 | |
---|
255 | } |
---|
256 | |
---|
257 | |
---|
258 | .remove { |
---|
259 | right:-11px; top:-11px; |
---|
260 | border:3px solid #BBB; |
---|
261 | border-radius:32px; |
---|
262 | |
---|
263 | background-color:#FFF; |
---|
264 | color:red; |
---|
265 | |
---|
266 | width:22px; |
---|
267 | height:22px; |
---|
268 | line-height:15px; |
---|
269 | } |
---|
270 | .file-label.selected + .remove:hover { |
---|
271 | border-color:@file-multi-remove-color; |
---|
272 | } |
---|
273 | |
---|
274 | } |
---|
275 | |
---|
276 | |
---|
277 | |
---|
278 | |
---|
279 | |
---|
280 | .ace-file-multiple .file-label { |
---|
281 | .file-name [class*="icon-"] { |
---|
282 | position:relative; |
---|
283 | display:block; |
---|
284 | text-align:center; |
---|
285 | height:auto; line-height:64px; |
---|
286 | width:auto; |
---|
287 | |
---|
288 | font-size:64px; color:#D5D5D5; |
---|
289 | |
---|
290 | margin:4px 0; |
---|
291 | |
---|
292 | background-color:transparent; |
---|
293 | } |
---|
294 | |
---|
295 | &.selected:after { |
---|
296 | display:none; |
---|
297 | } |
---|
298 | &.selected .file-name [class*="icon-"] { |
---|
299 | position:relative; |
---|
300 | margin-right:4px; margin-left:2px; |
---|
301 | line-height:24px; |
---|
302 | } |
---|
303 | |
---|
304 | |
---|
305 | .file-name.large { |
---|
306 | text-align:center; |
---|
307 | border-bottom:2px solid #222; |
---|
308 | margin:0 1px 3px; |
---|
309 | |
---|
310 | &:last-child { |
---|
311 | margin:0 1px; |
---|
312 | border-bottom-width:0; |
---|
313 | } |
---|
314 | &:after { /* image caption */ |
---|
315 | position:absolute; |
---|
316 | top:auto; bottom:0; left:0; right:0; |
---|
317 | padding:0 4px; |
---|
318 | background-color:#555; |
---|
319 | color:#FFF; |
---|
320 | .opacity(0.8); |
---|
321 | } |
---|
322 | |
---|
323 | img { |
---|
324 | border-width:0; |
---|
325 | margin:0; |
---|
326 | padding:0; |
---|
327 | } |
---|
328 | } |
---|
329 | |
---|
330 | } |
---|
331 | |
---|
332 | |
---|
333 | |
---|
334 | |
---|
335 | .ace-file-input input[type=file] { |
---|
336 | &.disabled , &[disabled] , &[readonly] { |
---|
337 | + .file-label { |
---|
338 | cursor: not-allowed; |
---|
339 | background-color:#EEE; |
---|
340 | &:hover { |
---|
341 | //box-shadow: 0 0 0 4px rgba(0,0,0,0.06); |
---|
342 | .box-shadow(none); |
---|
343 | border-color:#E3E3E3; |
---|
344 | } |
---|
345 | &:before { |
---|
346 | border-color:#EEE; |
---|
347 | background-color:#A1AAAF; |
---|
348 | } |
---|
349 | } |
---|
350 | } |
---|
351 | &[readonly] + .file-label { |
---|
352 | cursor:default; |
---|
353 | } |
---|
354 | |
---|
355 | } |
---|
356 | |
---|
357 | |
---|
358 | .ace-file-multiple input[type=file] { |
---|
359 | &.disabled , &[disabled] , &[readonly] { |
---|
360 | + .file-label { |
---|
361 | &:hover { |
---|
362 | border-color:#AAA; |
---|
363 | } |
---|
364 | &:before { |
---|
365 | background-color:transparent; |
---|
366 | } |
---|
367 | |
---|
368 | [class*="icon-"] { |
---|
369 | border-color:#EEE; |
---|
370 | } |
---|
371 | } |
---|
372 | } |
---|
373 | } |
---|
374 | |
---|
375 | |
---|
376 | |
---|
377 | |
---|
378 | |
---|
379 | /* IE9 needs this like IE8 to prevent "ACCESS denied" errors! */ |
---|
380 | .ace-file-input input[type=file] { |
---|
381 | /*must be visible and on top for ie8/9 to actually work */ |
---|
382 | width:~'100% \0/'; height:~'30px \0/'; |
---|
383 | position:~'absolute \0/'; |
---|
384 | z-index:~'1 \0/'; |
---|
385 | filter:alpha(opacity=0); |
---|
386 | cursor:~'pointer \0/'; |
---|
387 | } |
---|
388 | .ace-file-input input[type=file]:hover + .file-label { |
---|
389 | border-color: @file-input-hover-border~'\0/'; |
---|
390 | } |
---|
391 | .ace-file-multiple input[type=file] { |
---|
392 | height:~'100%\0/'; |
---|
393 | } |
---|
394 | .ace-file-input .remove { |
---|
395 | z-index:~'2\0/'; |
---|
396 | } |
---|