Blame view

src/styles/mixins/input.less 5.83 KB
95436eeb   梁灏   add InputNumber UI
1
2
3
  .hover(@color: @input-hover-border-color) {
      border-color: tint(@color, 20%);
  }
e93f1e9a   梁灏   update some styles
4
5
6
  .hover-error() {
      border-color: @error-color;
  }
95436eeb   梁灏   add InputNumber UI
7
8
  
  .active(@color: @input-hover-border-color) {
95436eeb   梁灏   add InputNumber UI
9
10
11
      outline: 0;
      box-shadow: 0 0 0 2px fade(@color, 20%);
  }
e93f1e9a   梁灏   update some styles
12
13
14
15
16
  .active-error() {
      border-color: @error-color;
      outline: 0;
      box-shadow: 0 0 0 2px fade(@error-color, 20%);
  }
95436eeb   梁灏   add InputNumber UI
17
18
19
20
21
22
23
24
25
26
27
28
  
  .disabled() {
      background-color: @input-disabled-bg;
      opacity: 1;
      cursor: @cursor-disabled;
      color: #ccc;
      &:hover {
          .hover(@input-border-color);
      }
  }
  
  .input-large() {
86cf21fd   梁灏   optimize button l...
29
      font-size: @font-size-base;
95436eeb   梁灏   add InputNumber UI
30
31
32
33
34
35
36
      padding: @input-padding-vertical-large @input-padding-horizontal;
      height: @input-height-large;
  }
  
  .input-small() {
      padding: @input-padding-vertical-small @input-padding-horizontal;
      height: @input-height-small;
ab8aaf95   梁灏   add Dropdown comp...
37
      border-radius: @btn-border-radius-small;
95436eeb   梁灏   add InputNumber UI
38
39
40
41
42
43
44
45
  }
  
  .input() {
      display: inline-block;
      width: 100%;
      height: @input-height-base;
      line-height: @line-height-base;
      padding: @input-padding-vertical-base @input-padding-horizontal;
86cf21fd   梁灏   optimize button l...
46
      font-size: @font-size-small;
95436eeb   梁灏   add InputNumber UI
47
      border: 1px solid @input-border-color;
ab8aaf95   梁灏   add Dropdown comp...
48
      border-radius: @btn-border-radius;
95436eeb   梁灏   add InputNumber UI
49
50
51
52
53
54
      color: @input-color;
      background-color: @input-bg;
      background-image: none;
      position: relative;
      cursor: text;
      .placeholder();
e2645048   jingsam   :fire: remove tra...
55
      transition: border @transition-time @ease-in-out, background @transition-time @ease-in-out, box-shadow @transition-time @ease-in-out;
95436eeb   梁灏   add InputNumber UI
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
  
      &:hover {
          .hover();
      }
  
      &:focus {
          .active();
      }
  
      &[disabled],
      fieldset[disabled] & {
          .disabled();
      }
  
      // Reset height for textarea
      textarea& {
          max-width: 100%;
          height: auto;
07614811   梁灏   update Input text...
74
          min-height: @input-height-base;
95436eeb   梁灏   add InputNumber UI
75
          vertical-align: bottom;
86cf21fd   梁灏   optimize button l...
76
          font-size: @font-size-base;
95436eeb   梁灏   add InputNumber UI
77
78
79
80
81
82
83
84
85
86
      }
  
      // Size
      &-large {
          .input-large();
      }
  
      &-small {
          .input-small();
      }
0f822c9b   梁灏   add Input component
87
88
  }
  
e93f1e9a   梁灏   update some styles
89
90
91
92
93
94
95
96
97
98
  .input-error() {
      border: 1px solid @error-color;
      &:hover {
          .hover-error;
      }
      &:focus {
          .active-error;
      }
  }
  
0f822c9b   梁灏   add Input component
99
100
101
102
103
  .input-group(@inputClass) {
      display: table;
      width: 100%;
      border-collapse: separate;
      position: relative;
86cf21fd   梁灏   optimize button l...
104
      font-size: @font-size-small;
8a83e7c4   梁灏   update Form
105
      top: 1px; // fixed when using in form inline,
86cf21fd   梁灏   optimize button l...
106
107
108
109
  
      &-large{
          font-size: @font-size-base;
      }
0f822c9b   梁灏   add Input component
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
  
      // Undo padding and float of grid classes
      &[class*="col-"] {
          float: none;
          padding-left: 0;
          padding-right: 0;
      }
  
      > [class*="col-"] {
          padding-right: 8px;
      }
  
      &-prepend,
      &-append,
      > .@{inputClass} {
          display: table-cell;
  
e2affe49   梁灏   fixed #397
127
128
129
130
          //&:not(:first-child):not(:last-child) {
          //    border-radius: 0;
          //}
      }
54c988f2   梁灏   fixed input cls w...
131
132
133
      &-with-prepend .@{inputClass},
      &-with-prepend&-small .@{inputClass}
      {
e2affe49   梁灏   fixed #397
134
135
136
          border-top-left-radius: 0;
          border-bottom-left-radius: 0;
      }
54c988f2   梁灏   fixed input cls w...
137
138
139
      &-with-append .@{inputClass},
      &-with-append&-small .@{inputClass}
      {
e2affe49   梁灏   fixed #397
140
141
          border-top-right-radius: 0;
          border-bottom-right-radius: 0;
0f822c9b   梁灏   add Input component
142
143
144
145
146
147
148
149
      }
  
      &-prepend .@{css-prefix}btn,
      &-append .@{css-prefix}btn
      {
          border-color: transparent;
          background-color: transparent;
          color: inherit;
31b721aa   梁灏   fixed Input style...
150
          margin: -(@input-padding-vertical-base + 2) (-@input-padding-horizontal);
0f822c9b   梁灏   add Input component
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
      }
  
      &-prepend,
      &-append
      {
          width: 1px; // To make addon/wrap as small as possible
          white-space: nowrap;
          vertical-align: middle;
      }
  
      .@{inputClass} {
          width: 100%;
          float: left;
          margin-bottom: 0;
          position: relative;
          z-index: 2;
      }
  
      &-prepend,
      &-append
      {
          padding: @input-padding-vertical-base @input-padding-horizontal;
86cf21fd   梁灏   optimize button l...
173
          font-size: inherit;
0f822c9b   梁灏   add Input component
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
          font-weight: normal;
          line-height: 1;
          color: @input-color;
          text-align: center;
          background-color: #eee;
          border: 1px solid @input-border-color;
          border-radius: @border-radius-base;
  
          // Reset Select's style in addon
          .@{css-prefix}select {
              margin: -(@input-padding-vertical-base + 1) (-@input-padding-horizontal);  // lesshint spaceAroundOperator: false
  
              &-selection {
                  background-color: inherit;
                  margin: -1px;
                  border: 1px solid transparent;
              }
  
              &-visible .@{css-prefix}select-selection{
                  box-shadow: none;
              }
          }
      }
  
      // Reset rounded corners
      > span > .@{inputClass}:first-child,
      > .@{inputClass}:first-child,
      &-prepend
      {
          border-bottom-right-radius: 0 !important;
          border-top-right-radius: 0 !important;
  
          // Reset Select's style in addon
          .@{css-prefix}-select .@{css-prefix}-select-selection {
              border-bottom-right-radius: 0;
              border-top-right-radius: 0;
          }
      }
  
      &-prepend {
          border-right: 0;
      }
      &-append {
          border-left: 0;
      }
  
      > .@{inputClass}:last-child,
      &-append
      {
          border-bottom-left-radius: 0 !important;
          border-top-left-radius: 0 !important;
  
          // Reset Select's style in addon
          .@{css-prefix}-select .@{css-prefix}-select-selection {
              border-bottom-left-radius: 0;
              border-top-left-radius: 0;
          }
      }
  
      // Sizing options
      &-large .@{inputClass},
      &-large > &-prepend,
      &-large > &-append
      {
          .input-large();
      }
  
      &-small .@{inputClass},
      &-small > &-prepend,
      &-small > &-append
      {
          .input-small();
      }
  }
e93f1e9a   梁灏   update some styles
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
  
  .input-group-error{
      &-prepend,
      &-append
      {
          background-color: #fff;
          border: 1px solid @error-color;
          .@{css-prefix}select {
              &-selection {
                  background-color: inherit;
                  border: 1px solid transparent;
              }
          }
      }
      &-prepend {
          border-right: 0;
      }
      &-append {
          border-left: 0;
      }
f2bcd4ad   Graham Fairweather   Color keyboard co...
268
  }