hjg
2023-11-18 bb48edb3d9faaaeab0088151c86fc24137acdb08
提交 | 用户 | 时间
58d006 1 //some extra form variables
A 2 //more important ones are inside "variables.less"
3
4 @input-placeholder-color:#C0C0C0;
5 @input-readonly-color:#939192;
6 @input-readonly-bg:#F5F5F5;
7 @input-readonly-focus-border:#AAA;
8 @input-readonly-focus-bg:#F9F9F9;
9 @input-readonly-focus-shadow:~"0px 0px 0px 2px rgba(150, 150, 150, 0.3)";
10
11 @input-disabled-color:#848484;
12 @input-disabled-bg:#EEE;
13
14 @input-hover-border:lighten(greyscale(@input-border-focus),10%);
15  
16 @option-hover-bg: #EEE;//desaturate(darken(#EEF5FA , 1%) , 4%);
17
18
19 //form error states
20 @success-state-border:lighten(#92BF65 , 4%);
21 @success-state-color:#8BAD4C;
22 @success-state-focus-border: darken(#81A85A , 4%);
23 @success-state-focus-color:darken(@success-state-color, 10%);
24 @success-state-focus-shadow:~"0px 0px 0px 2px rgba(130, 188, 58, 0.3)";
25 @success-state-text-color:#7BA065;//the color of the help text, etc inside that control label
26 @success-state-background-color: lighten(@success-state-border , 34.5%);
27
28 @error-state-border:lighten(#F09784 , 4%);
29 @error-state-color:#D68273;
30 @error-state-focus-border: darken(#DB8978 , 4%);
31 @error-state-focus-color:darken(@error-state-color, 10%);
32 @error-state-focus-shadow:~"0px 0px 0px 2px rgba(219, 137, 120, 0.3)";
33 @error-state-text-color:#D16E6C;
34 @error-state-background-color: lighten(@error-state-border , 21.5%);
35
36 @warning-state-border:lighten(#E0C43A , 4%);
37 @warning-state-color: #D3BD50;
38 @warning-state-focus-border: darken(#D8BC41 , 4%);
39 @warning-state-focus-color: darken(@warning-state-color, 10%);
40 @warning-state-focus-shadow:~"0px 0px 0px 2px rgba(216, 188, 65, 0.3)";
41 @warning-state-text-color:#D19D59;
42 @warning-state-background-color: lighten(@warning-state-border , 38%);
43
44 @info-state-border:lighten(#64A6BC , 4%);
45 @info-state-color:#4B89AA;
46 @info-state-focus-border: darken(#64A6BC , 10%);
47 @info-state-focus-color: darken(@info-state-color, 10%);
48 @info-state-focus-shadow:~"0px 0px 0px 2px rgba(58, 120, 188, 0.3)";
49 @info-state-text-color:#657BA0;
50 @info-state-background-color: lighten(@info-state-border , 35.5%);
51
52 @disabled-state-color:#848484;
53 @disabled-state-bg:#EEE;
54
55
56
57
58
59 //form elements
60 .form-line {
61   margin-bottom:24px; padding-bottom:12px;
62   border-bottom:1px solid #EEE;
63 }
64 .form-actions {
65   display:block;
66
67   background-color: #F5F5F5;
68   border-top: 1px solid #E5E5E5;
69   margin-bottom: 20px;
70   margin-top: 20px;
71   padding: 19px 20px 20px;
72 }
73
74 .help-button {
75   display: inline-block;
76   height: 22px;
77   width: 22px;
78   line-height: 22px;
79   text-align: center;
80   padding: 0;
81   background-color: @help-button-bg;
82   color: #FFF;
83   font-size: @font-size-help-button;
84   font-weight: bold;
85   cursor: default;
86  
87   margin-left: 4px;
88   .border-radius(100%);
89   border-color: #FFF;
90   border: 2px solid #FFF;
91  
92   .box-shadow(~"0px 1px 0px 1px rgba(0, 0, 0, 0.2)");
93   
94   &:hover {
95     background-color: @help-button-bg;
96     text-shadow: none;
97  }
98 }
99
100
101
102 label {
103  font-weight: normal;
104  font-size: @font-size-label;
105 }
106 .form-group > label[class*="col-"] {
107  //padding-top: 4px;
108  margin-bottom: 4px;
109 }
110
111
112 //label , .lbl {
113  //vertical-align: middle;
114 //}
115 td > label , th > label
116 {
117  margin-bottom: 0;
118  line-height: inherit;
119  vertical-align: middle;
120 }
121 label.inline {
122  margin-bottom: 3px;
123 }
124
125
126 textarea,
127 input[type="text"],
128 input[type="password"],
129 input[type="datetime"],
130 input[type="datetime-local"],
131 input[type="date"],
132 input[type="month"],
133 input[type="time"],
134 input[type="week"],
135 input[type="number"],
136 input[type="email"],
137 input[type="url"],
138 input[type="search"],
139 input[type="tel"],
140 input[type="color"] {
141  .border-radius(0) !important;
142  color: @input-color;
143  background-color: @input-background;
144  border: 1px solid @input-border;
145  
146  padding: 5px 4px 6px;
147  //line-height: 1.3;
148  font-size: @font-size-text-input;
149  font-family: inherit;
150
151  .box-shadow(none) !important;
152
153  .transition-duration(0.1s);
154  
155  &:hover {
156     border-color: @input-hover-border;
157  }
158  &:focus {
159     //.box-shadow(@input-shadow-focus);
160     .box-shadow(none);
161      
162     color: @input-color-focus;
163     border-color: @input-border-focus;
164     background-color: @input-background-focus;
165     outline: none;
166  }
167 }
168
169 input::-webkit-input-placeholder, .form-control::-webkit-input-placeholder {
170     color: @input-placeholder-color;
171 }
172 input:-moz-placeholder, .form-control:-moz-placeholder { //FF 4 - 18
173     color: @input-placeholder-color;
174     opacity: 1;
175 }
176 input::-moz-placeholder, .form-control::-moz-placeholder { //FF 19+
177     color: @input-placeholder-color;
178     opacity: 1;
179 }
180 input:-ms-input-placeholder, .form-control:-ms-input-placeholder { //IE 10+
181     color: @input-placeholder-color;
182 }
183
184
185
186
187
188 .form-control , select {
189   //line-height: 1;
190   border-radius : 0;
191   .box-shadow(none) !important;
192    
193   color: @input-color;
194   background-color: @input-background;
195   border:1px solid @input-border;
196   &:focus {
197
198     color: @input-color-focus;
199     border-color: @input-border-focus;
200     background-color: @input-background-focus;
201     outline:none;
202  }
203 }
204 textarea.form-control {
205   padding:5px 9px
206 }
207 select {
208   padding:3px 4px;
209   height: 30px;
210 }
211 select.form-control {
212   padding:4px 6px;
213   //height: 32px;
214 }
215 select[multiple] , select.form-control[multiple] {
216     height: auto;
217 }
218 select.input-sm {
219  border-radius: 0;
220  padding: 2px 3px;
221 }
222 select.input-lg {
223  border-radius: 0;
224  padding: 6px 8px; 
225 }
226
227
228 input.block {
229   display:block;
230   margin-bottom:9px;
231 }
232
233
234 textarea.autosize-transition {
235  .transition-duration("height 0.2s");
236 }
237 .limiterBox {
238   border: 1px solid #222;
239   border-top: none;
240   background-color: #333;
241   padding: 3px 6px;
242   font-size: @base-font-size;
243   color:#FFF;
244   margin-top:6px;
245   &:after {
246     display:none;
247   }
248  &:before {
249     display:block;
250     content:"";
251   
252     position: absolute;
253     width: 0; height: 0;
254     top: -8px;
255     left: 50%;
256     margin-left: -5px;
257   
258     border-color: transparent;
259     border-style: solid;
260     border-bottom-color: #333;
261     -moz-border-bottom-colors: #333;
262     border-width: 0 8px 8px;
263  }
264 }
265
266
267
268 select {
269  & , &.form-control {
270      option {
271         padding: 3px 4px 5px;
272         &:active , &:hover, &:focus {
273             background-color: @option-hover-bg;
274             color: #444;
275         }
276         &.no-option {
277             padding: 1px 0;
278         }
279      }
280  }
281 }
282
283
284
285 input[disabled] {
286   color: @input-disabled-color !important;
287   background-color: @input-disabled-bg !important;
288   &:hover {
289     border-color: @input-border !important;
290   }
291 }
292 input[readonly] {
293   color: @input-readonly-color;
294   background: @input-readonly-bg !important;
295   cursor:default;
296
297   &:hover {
298     border-color:lighten(@input-readonly-focus-border , 10%);
299   }
300   &:focus {
301     //.box-shadow(@input-readonly-focus-shadow);
302     .box-shadow(none);
303     border-color: @input-readonly-focus-border;
304     background-color: @input-readonly-focus-bg;
305   }
306 }
307
308 .help-inline {
309  font-size: @font-size-help-inline !important;
310 }
311
312
313
314 .input-icon {
315  position:relative;
316  span& {
317     display:inline-block;
318  }
319  
320  > input {
321     padding-left:24px;
322     padding-right:6px;
323  }
324  &.input-icon-right > input {
325     padding-left:6px;
326     padding-right:24px;
327  }
328
329  > .@{icon} {
330     padding: 0 3px;
331     z-index: 2;
332     position: absolute;
333     top: 1px;
334     bottom: 1px;
335     left: 3px;
336     line-height: 30px;
337  
338     display: inline-block;
339     color: #909090;
340     font-size: @font-size-input-icon;
341  }
342  
343  &.input-icon-right > .@{icon} {
344     left:auto;
345     right:3px;
346  }
347  
348  > input:focus + .@{icon} {
349     color:#579;
350  }
351
352  ~ .help-inline {
353     padding-left:8px;
354  }
355
356
357
358  //.form-group.has-warning & > .@{icon} { color: @warning-state-color; }
359  //.form-group.has-success & > .@{icon} { color: @success-state-color; }
360  //.form-group.has-error & > .@{icon} { color: @error-state-color; }
361  //.form-group.has-info & > .@{icon} { color: @info-state-color; }
362 }
363
364
365
366
367 //checkboxes , radio and switches
368 .form-search , .form-inline {
369     .radio [type=radio] + label, .checkbox [type=checkbox] + label {
370          float: left;
371          margin-left: -20px;
372
373         .form-search & , .form-inline & {
374             margin-left:0;
375             margin-right:3px;
376         }
377     }
378 }
379
380 .input-append , .input-prepend {
381  .form-search & .search-query:focus {
382     .box-shadow(none);
383  }
384  input, select, .uneditable-input {
385     .border-radius(0);
386  }
387 }
388
389
390
391 .input-mini {
392   width: 60px;
393   max-width: 100%;
394 }
395
396 .input-small {
397   width: 90px;
398   max-width: 100%;
399 }
400
401 .input-medium , .input-md {
402   width: 150px;
403   max-width: 100%;
404 }
405
406 .input-large {
407   width: 210px;
408   max-width: 100%;
409 }
410
411 .input-xlarge {
412   width: 270px;
413   max-width: 100%;
414 }
415
416 .input-xxlarge {
417   width: 530px;
418   max-width: 100%;
419 }
420 input.input-lg {
421   font-size: @font-size-large;
422 }
423
424
425
426
427 @import "form/checkbox.less";
428 @import "form/file.less";
429
430
431
432 //addon
433 .input-group {
434     .input-group-addon {
435         .border-radius(0) !important;    
436
437         .form-group.has-success & {
438             border-color: @success-state-border;
439         }
440         .form-group.has-error & {
441             border-color: @error-state-border;
442         }
443         .form-group.has-warning & {
444             border-color: @warning-state-border;
445         }
446         .form-group.has-info & {
447             border-color: @info-state-border;
448         }
449     }
450     
451     
452     > .btn {
453         line-height:20px;
454         padding:0 6px;
455         .border-radius(0) !important;
456
457         &.btn-sm {
458             line-height:22px;
459         }
460         
461         + .btn{
462             margin-left:1px;
463         }
464     }
465     
466     > .btn-group > .btn {
467         line-height:23px;
468         
469         &.btn-sm {
470             line-height:26px;
471         }
472     }
473     
474     > .btn , > .btn-group > .btn {
475         & , &.btn-sm {
476             > .caret {
477                 margin-top:10px;
478             }
479         }
480     }
481 }
482
483 .input-group.input-group-compact {
484   width: 1px;
485 }
486
487 .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn {
488  padding-top: 6px;
489  padding-bottom: 6px;
490 }
491
492
493
494 //input error states
495 .form-group select,
496 .form-group textarea,
497 .form-group input[type="text"],
498 .form-group input[type="password"],
499 .form-group input[type="datetime"],
500 .form-group input[type="datetime-local"],
501 .form-group input[type="date"],
502 .form-group input[type="month"],
503 .form-group input[type="time"],
504 .form-group input[type="week"],
505 .form-group input[type="number"],
506 .form-group input[type="email"],
507 .form-group input[type="url"],
508 .form-group input[type="search"],
509 .form-group input[type="tel"],
510 .form-group input[type="color"] {
511     background:#FFF;
512 }
513 .form-group.has-success {
514  input, select, textarea {
515     border-color: @success-state-border;
516     color: @success-state-color;
517     .box-shadow(none);
518
519     &:focus {
520         .box-shadow(@success-state-focus-shadow);
521         color: @success-state-focus-color;
522         border-color: @success-state-focus-border;
523         background-color: @success-state-background-color;
524         
525         + .@{icon} {
526             color: @success-state-color;
527         }        
528     }
529  }
530  .@{icon} {
531     color: @success-state-color;
532  }
533  .btn .@{icon} {
534     color: inherit;
535  }
536
537  .control-label , .help-block  , .help-inline {
538     color: @success-state-text-color;
539  }
540 }
541
542 .form-group.has-info {
543  input , select, textarea {
544     border-color: @info-state-border;
545     color: @info-state-color;
546     .box-shadow(none);
547
548     &:focus {
549         .box-shadow(@info-state-focus-shadow);
550         color: @info-state-focus-color;
551         border-color: @info-state-focus-border;
552         background-color: @info-state-background-color;
553         
554         + .@{icon} {
555             color: @info-state-color;
556         }
557     }
558  }
559  .@{icon} {
560     color: @info-state-color;
561  }
562  .btn .@{icon} {
563     color: inherit;
564  }
565  
566  .control-label , .help-block  , .help-inline {
567     color: @info-state-text-color;
568  }
569 }
570
571
572 .form-group.has-error {
573  input , select, textarea {
574     border-color: @error-state-border;
575     color: @error-state-color;
576     .box-shadow(none);
577
578     &:focus {
579         .box-shadow(@error-state-focus-shadow);
580         color: @error-state-focus-color;
581         border-color: @error-state-focus-border;
582         background-color: @error-state-background-color;
583         
584         + .@{icon} {
585             color: @error-state-color;
586         }
587     }
588  }
589  .@{icon} {
590     color: @error-state-color;
591  }
592  .btn .@{icon} {
593     color: inherit;
594  }
595
596  .control-label , .help-block  , .help-inline {
597     color: @error-state-text-color;
598  }
599 }
600
601
602
603 .form-group.has-warning {
604  input , select, textarea {
605     border-color: @warning-state-border;
606     color: @warning-state-color;
607     .box-shadow(none);
608
609     &:focus {
610         .box-shadow(@warning-state-focus-shadow);
611         color: @warning-state-focus-color;
612         border-color: @warning-state-focus-border;
613         background-color: @warning-state-background-color;
614         
615         + .@{icon} {
616             color: @warning-state-color;
617         }
618     }
619  }
620  .@{icon} {
621     color: @warning-state-color;
622  }
623  .btn .@{icon} {
624     color: inherit;
625  }
626
627  .control-label , .help-block  , .help-inline {
628     color: @warning-state-text-color;
629  }
630 }
631
632 .form-group input{
633  &[disabled] , &:disabled{
634     color: @disabled-state-color !important;
635     background-color: @disabled-state-bg !important;
636  }
637 }
638
639
640
641 input[type].input-transparent, textarea.input-transparent, .input-transparent {
642     background-color: rgba(0, 0, 0, 0.5);
643     color: #bbb;
644     border-color: transparent !important;
645     
646     &:focus {
647         background-color: rgba(0, 0, 0, 0.66);
648         color: #f0f0f0;
649     }
650 }
651
652
653
654
655 @media only screen and (max-width: @screen-xs-max) {
656  .help-inline , .input-icon + .help-inline {
657   padding-left: 0;
658   display: block !important;
659  }
660 }
661