Blame view

src/styles/components/select.less 6.69 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
169
  
          &[disabled]{
              cursor: @cursor-disabled;
              color: #ccc;
          }
e355dd49   梁灏   add Select Component
170
171
172
173
174
175
176
      }
  
      &-single &-input{
          width: 100%;
      }
  
      &-large &-input{
86cf21fd   梁灏   optimize button l...
177
          font-size: @font-size-base;
e355dd49   梁灏   add Select Component
178
179
180
181
          height: @input-height-large;
      }
  
      &-small &-input{
71ef4865   梁灏   fixed #860
182
183
          height: @input-height-small - 2px;
          line-height: @input-height-small - 2px;
e355dd49   梁灏   add Select Component
184
      }
e4ce9917   梁灏   update Select com...
185
186
  
      &-multiple &-input{
3c01d81a   梁灏   fixed Modal bug,w...
187
188
          height: @input-height-base - 3px;
          line-height: @input-height-base;
ba3e34e0   梁灏   update some styles
189
          padding: 0 0 0 4px;
e4ce9917   梁灏   update Select com...
190
191
192
193
194
      }
  
      &-not-found{
          text-align: center;
          color: @btn-disable-color;
a28bc982   梁灏   update Cascader s...
195
196
197
          li:not([class^=ivu-]){
              margin-bottom: 0;
          }
e4ce9917   梁灏   update Select com...
198
      }
01b54e30   梁灏   Select support re...
199
200
201
202
      &-loading{
          text-align: center;
          color: @btn-disable-color;
      }
3c01d81a   梁灏   fixed Modal bug,w...
203
204
  
      &-multiple .@{css-prefix}tag{
5ddf1bcf   梁灏   fixed #2451
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
          height: 24px;
          line-height: 22px;
          margin: 3px 4px 3px 0;
      }
  
      &-large&-multiple .@{css-prefix}tag{
          height: 28px;
          line-height: 26px;
          font-size: @font-size-base;
      }
  
      &-small&-multiple .@{css-prefix}tag{
          height: 17px;
          line-height: 15px;
          font-size: @font-size-small;
          padding: 0 6px;
3c01d81a   梁灏   fixed Modal bug,w...
221
222
          margin: 3px 4px 2px 0;
      }
9ad57f29   Sergio Crisostomo   correct list-styl...
223
224
  
      &-dropdown-list {
82da2543   huangrd   Fixed #2931
225
226
          display: inline-block;
          min-width: 100%;
9ad57f29   Sergio Crisostomo   correct list-styl...
227
228
          list-style: none;
      }
e355dd49   梁灏   add Select Component
229
230
  }
  
c463ab87   梁灏   add Cascader
231
  .select-item(@select-prefix-cls, @select-item-prefix-cls);
3a2c6fc7   梁灏   optimize Select a...
232
  
e355dd49   梁灏   add Select Component
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
  .@{select-prefix-cls}-multiple .@{select-item-prefix-cls} {
      &-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();
          float: right;
          font-size: 24px;
          content: '\F3FD';
          color: @selected-color;
      }
  }
  
  .@{select-group-prefix-cls} {
      list-style: none;
      margin: 0;
      padding: 0;
  
      &-title {
9a9e103f   梁灏   optimize Select s...
262
          padding-left: 8px;
e355dd49   梁灏   add Select Component
263
264
265
266
267
          font-size: 12px;
          color: @legend-color;
          height: 30px;
          line-height: 30px;
      }
e2645048   jingsam   :fire: remove tra...
268
  }
e93f1e9a   梁灏   update some styles
269
270
271
272
273
274
275
276
277
278
279
280
281
  
  .@{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...
282
  }