Blame view

src/styles/components/select.less 7.39 KB
e355dd49   梁灏   add Select Component
1
2
3
4
5
6
7
8
9
10
11
  @select-prefix-cls: ~"@{css-prefix}select";
  @select-item-prefix-cls: ~"@{css-prefix}select-item";
  @select-group-prefix-cls: ~"@{css-prefix}select-group";
  
  .@{select-prefix-cls} {
      display: inline-block;
      width: 100%;
      box-sizing: border-box;
      vertical-align: middle;
      color: @text-color;
      font-size: @font-size-base;
d509d2b2   梁灏   fixed #192
12
      //position: relative;
ba3e34e0   梁灏   update some styles
13
      line-height: normal;
e355dd49   梁灏   add Select Component
14
15
16
17
18
  
      &-selection {
          display: block;
          box-sizing: border-box;
          outline: none;
e2645048   jingsam   :fire: remove tra...
19
          user-select: none;
e355dd49   梁灏   add Select Component
20
          cursor: pointer;
d509d2b2   梁灏   fixed #192
21
          position: relative;
e355dd49   梁灏   add Select Component
22
23
24
25
  
          background-color: #fff;
          border-radius: @btn-border-radius;
          border: 1px solid @border-color-base;
e2645048   jingsam   :fire: remove tra...
26
          transition: all @transition-time @ease-in-out;
e355dd49   梁灏   add Select Component
27
  
c9b86944   Sergio Crisostomo   Refactor Select!
28
          &:hover, &-focused {
e355dd49   梁灏   add Select Component
29
              .hover();
c9b86944   Sergio Crisostomo   Refactor Select!
30
              .@{select-prefix-cls}-arrow {
e355dd49   梁灏   add Select Component
31
32
33
34
35
                  display: inline-block;
              }
          }
      }
  
e355dd49   梁灏   add Select Component
36
      &-arrow {
165bb7c9   梁灏   update Cascader
37
          .inner-arrow();
e355dd49   梁灏   add Select Component
38
39
40
41
42
43
44
      }
  
      &-visible{
          .@{select-prefix-cls}-selection{
              .active();
          }
  
c9b86944   Sergio Crisostomo   Refactor Select!
45
          .@{select-prefix-cls}-arrow {
e2645048   jingsam   :fire: remove tra...
46
              transform: rotate(180deg);
c9b86944   Sergio Crisostomo   Refactor Select!
47
              display: inline-block;
2fbe636b   梁灏   Select support a ...
48
49
          }
      }
e355dd49   梁灏   add Select Component
50
51
52
53
54
  
      &-disabled {
          .@{select-prefix-cls}-selection {
              .disabled();
  
c9b86944   Sergio Crisostomo   Refactor Select!
55
              .@{select-prefix-cls}-arrow {
e355dd49   梁灏   add Select Component
56
57
58
59
60
61
62
                  display: none;
              }
  
              &:hover {
                  border-color: @border-color-base;
                  box-shadow: none;
  
c9b86944   Sergio Crisostomo   Refactor Select!
63
                  .@{select-prefix-cls}-arrow {
e355dd49   梁灏   add Select Component
64
65
66
67
68
69
70
                      display: inline-block;
                  }
              }
          }
      }
  
      &-single &-selection{
3c01d81a   梁灏   fixed Modal bug,w...
71
          height: @input-height-base;
e355dd49   梁灏   add Select Component
72
73
74
75
76
77
78
79
          position: relative;
  
          .@{select-prefix-cls}-placeholder{
              color: @input-placeholder-color;
          }
  
          .@{select-prefix-cls}-placeholder, .@{select-prefix-cls}-selected-value{
              display: block;
3c01d81a   梁灏   fixed Modal bug,w...
80
81
              height: @input-height-base - 2px;
              line-height: @input-height-base - 2px;
86cf21fd   梁灏   optimize button l...
82
              font-size: @font-size-small;
e355dd49   梁灏   add Select Component
83
84
85
86
87
88
89
90
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
              padding-left: 8px;
              padding-right: 24px;
          }
      }
  
5ddf1bcf   梁灏   fixed #2451
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
      &-multiple &-selection{
          padding: 0 24px 0 4px;
          //min-height: @input-height-base;
  
          .@{select-prefix-cls}-placeholder{
              display: block;
              height: @input-height-base - 2px;
              line-height: @input-height-base - 2px;
              color: @input-placeholder-color;
              font-size: @font-size-small;
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
              padding-left: 4px;
              padding-right: 22px;
          }
      }
  
e355dd49   梁灏   add Select Component
109
      &-large&-single &-selection{
3c01d81a   梁灏   fixed Modal bug,w...
110
          height: @input-height-large;
e355dd49   梁灏   add Select Component
111
112
  
          .@{select-prefix-cls}-placeholder, .@{select-prefix-cls}-selected-value{
3c01d81a   梁灏   fixed Modal bug,w...
113
114
              height: @input-height-large - 2px;
              line-height: @input-height-large - 2px;
86cf21fd   梁灏   optimize button l...
115
              font-size: @font-size-base;
e355dd49   梁灏   add Select Component
116
117
118
          }
      }
  
5ddf1bcf   梁灏   fixed #2451
119
120
121
122
123
124
125
126
127
128
      &-large&-multiple &-selection{
          min-height: @input-height-large;
  
          .@{select-prefix-cls}-placeholder, .@{select-prefix-cls}-selected-value{
              min-height: @input-height-large - 2px;
              line-height: @input-height-large - 2px;
              font-size: @font-size-base;
          }
      }
  
e355dd49   梁灏   add Select Component
129
      &-small&-single &-selection{
3c01d81a   梁灏   fixed Modal bug,w...
130
          height: @input-height-small;
e355dd49   梁灏   add Select Component
131
132
133
          border-radius: @btn-border-radius-small;
  
          .@{select-prefix-cls}-placeholder, .@{select-prefix-cls}-selected-value{
3c01d81a   梁灏   fixed Modal bug,w...
134
135
              height: @input-height-small - 2px;
              line-height: @input-height-small - 2px;
e355dd49   梁灏   add Select Component
136
137
138
          }
      }
  
5ddf1bcf   梁灏   fixed #2451
139
140
141
      &-small&-multiple &-selection{
          min-height: @input-height-small;
          border-radius: @btn-border-radius-small;
e355dd49   梁灏   add Select Component
142
  
5ddf1bcf   梁灏   fixed #2451
143
144
145
146
          .@{select-prefix-cls}-placeholder, .@{select-prefix-cls}-selected-value{
              height: auto;
              min-height: @input-height-small - 2px;
              line-height: @input-height-small - 2px;
e355dd49   梁灏   add Select Component
147
148
149
150
151
152
153
154
155
          }
      }
  
      // input
      &-input{
          display: inline-block;
          height: @input-height-base;
          line-height: @input-height-base;
          padding: 0 24px 0 8px;
86cf21fd   梁灏   optimize button l...
156
          font-size: @font-size-small;
e355dd49   梁灏   add Select Component
157
158
159
160
161
162
163
164
          outline: none;
          border: none;
          box-sizing: border-box;
          color: @input-color;
          background-color: transparent;
          position: relative;
          cursor: pointer;
          .placeholder();
feb21a0a   梁灏   fixed #2893
165
166
167
168
  
          &[disabled]{
              cursor: @cursor-disabled;
              color: #ccc;
f37a6d10   梁灏   Update select.less
169
              -webkit-text-fill-color: #ccc;  // #5249
feb21a0a   梁灏   fixed #2893
170
          }
e355dd49   梁灏   add Select Component
171
172
173
174
175
176
177
      }
  
      &-single &-input{
          width: 100%;
      }
  
      &-large &-input{
86cf21fd   梁灏   optimize button l...
178
          font-size: @font-size-base;
e355dd49   梁灏   add Select Component
179
180
181
182
          height: @input-height-large;
      }
  
      &-small &-input{
71ef4865   梁灏   fixed #860
183
184
          height: @input-height-small - 2px;
          line-height: @input-height-small - 2px;
e355dd49   梁灏   add Select Component
185
      }
e4ce9917   梁灏   update Select com...
186
187
  
      &-multiple &-input{
3c01d81a   梁灏   fixed Modal bug,w...
188
189
          height: @input-height-base - 3px;
          line-height: @input-height-base;
ba3e34e0   梁灏   update some styles
190
          padding: 0 0 0 4px;
e4ce9917   梁灏   update Select com...
191
192
193
194
195
      }
  
      &-not-found{
          text-align: center;
          color: @btn-disable-color;
a28bc982   梁灏   update Cascader s...
196
197
198
          li:not([class^=ivu-]){
              margin-bottom: 0;
          }
e4ce9917   梁灏   update Select com...
199
      }
01b54e30   梁灏   Select support re...
200
201
202
203
      &-loading{
          text-align: center;
          color: @btn-disable-color;
      }
3c01d81a   梁灏   fixed Modal bug,w...
204
205
  
      &-multiple .@{css-prefix}tag{
5ddf1bcf   梁灏   fixed #2451
206
207
208
          height: 24px;
          line-height: 22px;
          margin: 3px 4px 3px 0;
2dc68882   梁灏   fix #4938
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
          max-width: 99%;
          position: relative;
          span{
              display: block;
              margin-right: 14px;
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
          }
          i{
              display: block;
              position: absolute;
              right: 4px;
              top: 4px;
          }
5ddf1bcf   梁灏   fixed #2451
224
225
226
227
228
229
      }
  
      &-large&-multiple .@{css-prefix}tag{
          height: 28px;
          line-height: 26px;
          font-size: @font-size-base;
7261cc52   梁灏   update Select Tag...
230
          i{
2dc68882   梁灏   fix #4938
231
              top: 6px;
7261cc52   梁灏   update Select Tag...
232
          }
5ddf1bcf   梁灏   fixed #2451
233
234
235
236
237
238
239
      }
  
      &-small&-multiple .@{css-prefix}tag{
          height: 17px;
          line-height: 15px;
          font-size: @font-size-small;
          padding: 0 6px;
3c01d81a   梁灏   fixed Modal bug,w...
240
          margin: 3px 4px 2px 0;
2dc68882   梁灏   fix #4938
241
242
243
          span{
              margin-right: 14px;
          }
7261cc52   梁灏   update Select Tag...
244
245
          i{
              top: 1px;
2dc68882   梁灏   fix #4938
246
              right: 2px;
7261cc52   梁灏   update Select Tag...
247
          }
3c01d81a   梁灏   fixed Modal bug,w...
248
      }
9ad57f29   Sergio Crisostomo   correct list-styl...
249
250
  
      &-dropdown-list {
8c82b6f2   梁灏   update Select
251
          //display: inline-block;
82da2543   huangrd   Fixed #2931
252
          min-width: 100%;
9ad57f29   Sergio Crisostomo   correct list-styl...
253
254
          list-style: none;
      }
74ef0a6a   梁灏   fixed #4194
255
256
257
258
  
      & &-dropdown{
          width: auto;
      }
e355dd49   梁灏   add Select Component
259
260
  }
  
c463ab87   梁灏   add Cascader
261
  .select-item(@select-prefix-cls, @select-item-prefix-cls);
3a2c6fc7   梁灏   optimize Select a...
262
  
e355dd49   梁灏   add Select Component
263
  .@{select-prefix-cls}-multiple .@{select-item-prefix-cls} {
4c6060dc   梁灏   fixed Select mult...
264
      position: relative;
e355dd49   梁灏   add Select Component
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
      &-selected{
          color: @selected-color;
          background: #fff;
      }
      &-focus,&-selected:hover{
          background: @background-color-select-hover;
      }
  
      &-selected&-focus {
          color: shade(@selected-color, 10%);
          background: #fff;
      }
  
      &-selected:after{
          .ivu-icon();
4c6060dc   梁灏   fixed Select mult...
280
          //float: right;
e355dd49   梁灏   add Select Component
281
          font-size: 24px;
ca69e094   梁灏   update icons
282
          content: '\F171';
e355dd49   梁灏   add Select Component
283
          color: @selected-color;
4c6060dc   梁灏   fixed Select mult...
284
285
          position: absolute;
          top: 2px;
ba8e03c6   梁灏   update Select che...
286
          right: 8px;
e355dd49   梁灏   add Select Component
287
288
289
290
291
292
293
294
295
      }
  }
  
  .@{select-group-prefix-cls} {
      list-style: none;
      margin: 0;
      padding: 0;
  
      &-title {
9a9e103f   梁灏   optimize Select s...
296
          padding-left: 8px;
e355dd49   梁灏   add Select Component
297
298
299
300
301
          font-size: 12px;
          color: @legend-color;
          height: 30px;
          line-height: 30px;
      }
e2645048   jingsam   :fire: remove tra...
302
  }
e93f1e9a   梁灏   update some styles
303
304
305
306
307
308
309
310
311
312
313
314
315
  
  .@{form-item-prefix-cls}-error{
      .@{select-prefix-cls}{
          &-selection{
              border: 1px solid @error-color;
          }
          &-arrow{
              color: @error-color;
          }
          &-visible .@{select-prefix-cls}-selection{
              .active-error;
          }
      }
9ad57f29   Sergio Crisostomo   correct list-styl...
316
  }