Blame view

src/styles/components/tag.less 5.89 KB
4ec205b6   梁灏   add Tag UI
1
  @tag-prefix-cls: ~"@{css-prefix}tag";
9eba26fe   梁灏   update Select Icons
2
  @tag-close-prefix-cls: ivu-icon-ios-close;
4ec205b6   梁灏   add Tag UI
3
4
5
6
7
8
9
  
  .@{tag-prefix-cls} {
      display: inline-block;
      height: 22px;
      line-height: 22px;
      margin: 2px 4px 2px 0;
      padding: 0 8px;
4ec205b6   梁灏   add Tag UI
10
      border: 1px solid @border-color-split;
382c000c   梁灏   Tag add type prop...
11
      border-radius: @btn-border-radius-small;
4ec205b6   梁灏   add Tag UI
12
13
14
15
16
17
      background: @background-color-base;
      font-size: @tag-font-size;
      vertical-align: middle;
      opacity: 1;
      overflow: hidden;
      cursor: pointer;
e2645048   jingsam   :fire: remove tra...
18
      //transition: all @transition-time @ease-in-out;
4ec205b6   梁灏   add Tag UI
19
  
7afb4061   梁灏   update Tag style ...
20
21
22
23
      // for color and unchecked
      &:not(&-border):not(&-dot):not(&-checked){
          background: transparent;
          border: 0;
2079c47b   梁灏   update Tag
24
25
26
27
          color: @text-color;
          .@{tag-close-prefix-cls} {
              color: @text-color !important;
          }
7afb4061   梁灏   update Tag style ...
28
29
      }
  
7d4b325b   zhigang.li   close #2406
30
      &-color{
855d4940   梁灏   Tag add more colo...
31
          &-error{
7d4b325b   zhigang.li   close #2406
32
              color: @error-color !important;
d649c177   zhigang.li   udpate
33
              border-color: @error-color;
7d4b325b   zhigang.li   close #2406
34
          }
855d4940   梁灏   Tag add more colo...
35
          &-success{
7d4b325b   zhigang.li   close #2406
36
              color: @success-color !important;
d649c177   zhigang.li   udpate
37
              border-color: @success-color;
7d4b325b   zhigang.li   close #2406
38
          }
855d4940   梁灏   Tag add more colo...
39
          &-primary{
7d4b325b   zhigang.li   close #2406
40
              color: @link-color !important;
d649c177   zhigang.li   udpate
41
              border-color: @link-color;
7d4b325b   zhigang.li   close #2406
42
          }
855d4940   梁灏   Tag add more colo...
43
          &-warning{
7d4b325b   zhigang.li   close #2406
44
              color: @warning-color !important;
d649c177   zhigang.li   udpate
45
              border-color: @warning-color;
7d4b325b   zhigang.li   close #2406
46
47
48
49
50
51
          }
          &-white{
              color: rgb(255, 255, 255) !important;
          }
      }
  
382c000c   梁灏   Tag add type prop...
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
      &-dot{
          height: 32px;
          line-height: 32px;
          border: 1px solid @border-color-split !important;
          color: @text-color !important;
          background: #fff !important;
          padding: 0 12px;
  
          &-inner{
              display: inline-block;
              width: 12px;
              height: 12px;
              margin-right: 8px;
              border-radius: 50%;
              background: @border-color-split;
              position: relative;
              top: 1px;
          }
          .@{tag-close-prefix-cls} {
              color: #666 !important;
              margin-left: 12px !important;
          }
      }
  
      &-border{
          height: 24px;
          line-height: 24px;
7d4b325b   zhigang.li   close #2406
79
80
          border: 1px solid @border-color-split;
          color: @border-color-split;
382c000c   梁灏   Tag add type prop...
81
82
83
84
          background: #fff !important;
          position: relative;
  
          .@{tag-close-prefix-cls} {
7d4b325b   zhigang.li   close #2406
85
              color: #666;
382c000c   梁灏   Tag add type prop...
86
87
88
89
90
91
92
              margin-left: 12px !important;
          }
  
          &:after{
              content: "";
              display: none;
              width: 1px;
7d4b325b   zhigang.li   close #2406
93
              background: currentColor;
382c000c   梁灏   Tag add type prop...
94
95
96
97
98
99
100
101
102
103
104
105
              position: absolute;
              top: 0;
              bottom: 0;
              right: 22px;
          }
  
          &.@{tag-prefix-cls}-closable {
              &:after{
                  display: block;
              }
              .@{tag-close-prefix-cls} {
                  margin-left: 18px !important;
b972db9e   梁灏   update Tag style
106
                  left: 4px;
b577d60a   梁灏   update Tag & Sele...
107
                  top: -1px;
382c000c   梁灏   Tag add type prop...
108
109
110
              }
          }
  
855d4940   梁灏   Tag add more colo...
111
          &.@{tag-prefix-cls}-primary {
382c000c   梁灏   Tag add type prop...
112
              color: @link-color !important;
b094c2b6   梁灏   optimize Tag bord...
113
114
115
116
117
118
119
120
              border: 1px solid @link-color !important;
  
              &:after{
                  background: @link-color;
              }
              .@{tag-close-prefix-cls}{
                  color: @link-color !important;
              }
382c000c   梁灏   Tag add type prop...
121
          }
855d4940   梁灏   Tag add more colo...
122
          &.@{tag-prefix-cls}-success {
382c000c   梁灏   Tag add type prop...
123
              color: @success-color !important;
b094c2b6   梁灏   optimize Tag bord...
124
125
126
127
128
129
130
131
              border: 1px solid @success-color !important;
  
              &:after{
                  background: @success-color;
              }
              .@{tag-close-prefix-cls}{
                  color: @success-color !important;
              }
382c000c   梁灏   Tag add type prop...
132
          }
855d4940   梁灏   Tag add more colo...
133
          &.@{tag-prefix-cls}-warning {
382c000c   梁灏   Tag add type prop...
134
              color: @warning-color !important;
b094c2b6   梁灏   optimize Tag bord...
135
136
137
138
139
140
141
142
              border: 1px solid @warning-color !important;
  
              &:after{
                  background: @warning-color;
              }
              .@{tag-close-prefix-cls}{
                  color: @warning-color !important;
              }
382c000c   梁灏   Tag add type prop...
143
          }
855d4940   梁灏   Tag add more colo...
144
          &.@{tag-prefix-cls}-error {
382c000c   梁灏   Tag add type prop...
145
              color: @error-color !important;
b094c2b6   梁灏   optimize Tag bord...
146
147
148
149
150
151
152
153
              border: 1px solid @error-color !important;
  
              &:after{
                  background: @error-color;
              }
              .@{tag-close-prefix-cls}{
                  color: @error-color !important;
              }
382c000c   梁灏   Tag add type prop...
154
155
156
          }
      }
  
4ec205b6   梁灏   add Tag UI
157
158
159
160
161
162
163
      &:hover {
          opacity: 0.85;
      }
  
      &,
      a,
      a:hover {
7d4b325b   zhigang.li   close #2406
164
          // color: @text-color;
4ec205b6   梁灏   add Tag UI
165
166
167
168
169
170
171
172
      }
  
      &-text {
          a:first-child:last-child {
              display: inline-block;
              margin: 0 -8px;
              padding: 0 8px;
          }
7d4b325b   zhigang.li   close #2406
173
          color: @text-color;
4ec205b6   梁灏   add Tag UI
174
175
176
177
178
      }
  
      .@{tag-close-prefix-cls} {
          .iconfont-size-under-12px(20px);
          cursor: pointer;
fb7f5ddf   梁灏   update Select tag...
179
          margin-left: 2px;
4ec205b6   梁灏   add Tag UI
180
181
182
          color: #666;
          opacity: 0.66;
          position: relative;
b577d60a   梁灏   update Tag & Sele...
183
          top: -1px;
e2645048   jingsam   :fire: remove tra...
184
          //transition: all @transition-time @ease-in-out;
4ec205b6   梁灏   add Tag UI
185
186
187
188
189
190
  
          &:hover {
              opacity: 1;
          }
      }
  
855d4940   梁灏   Tag add more colo...
191
192
193
194
      &-primary,
      &-success,
      &-warning,
      &-error {
4ec205b6   梁灏   add Tag UI
195
196
197
198
199
200
201
202
          border: 0;
          &,
          a,
          a:hover,
          .@{tag-close-prefix-cls},
          .@{tag-close-prefix-cls}:hover {
              color: #fff;
          }
b972db9e   梁灏   update Tag style
203
204
205
          .@{tag-close-prefix-cls}{
              top: 2px;
          }
4ec205b6   梁灏   add Tag UI
206
207
      }
  
855d4940   梁灏   Tag add more colo...
208
209
      &-primary,
      &-primary&-dot &-dot-inner
382c000c   梁灏   Tag add type prop...
210
      {
4ec205b6   梁灏   add Tag UI
211
212
213
          background: @link-color;
      }
  
855d4940   梁灏   Tag add more colo...
214
215
      &-success,
      &-success&-dot &-dot-inner
382c000c   梁灏   Tag add type prop...
216
      {
4ec205b6   梁灏   add Tag UI
217
218
219
          background: @success-color;
      }
  
855d4940   梁灏   Tag add more colo...
220
221
      &-warning,
      &-warning&-dot &-dot-inner
382c000c   梁灏   Tag add type prop...
222
      {
4ec205b6   梁灏   add Tag UI
223
224
225
          background: @warning-color;
      }
  
855d4940   梁灏   Tag add more colo...
226
227
      &-error,
      &-error&-dot &-dot-inner
382c000c   梁灏   Tag add type prop...
228
      {
4ec205b6   梁灏   add Tag UI
229
230
          background: @error-color;
      }
855d4940   梁灏   Tag add more colo...
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
  
      @colors: pink, magenta, red, volcano, orange, yellow, gold, cyan, lime, green, blue, geekblue, purple;
  
      .make-color-classes(@i: length(@colors)) when (@i > 0) {
          .make-color-classes(@i - 1);
          @color: extract(@colors, @i);
          @lightColor: "@{color}-1";
          @lightBorderColor: "@{color}-3";
          @darkColor: "@{color}-6";
          &-@{color} {
              line-height: 20px;
              background: @@lightColor;
              border-color: @@lightBorderColor;
              .@{tag-prefix-cls}-text{
                  color: @@darkColor !important;
              }
          }
      }
  
      .make-color-classes();
7afb4061   梁灏   update Tag style ...
251
  }