Skip to content

Commit 17454b2

Browse files
authored
feat: tag support status color (#3166)
1 parent f3063e0 commit 17454b2

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

components/style/themes/default.less

+1
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@
487487
@tag-default-bg: @background-color-light;
488488
@tag-default-color: @text-color;
489489
@tag-font-size: @font-size-sm;
490+
@tag-line-height: 20px;
490491

491492
// TimePicker
492493
// ---

components/tag/style/index.less

+24-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
margin-right: 8px;
1212
padding: 0 7px;
1313
font-size: @tag-font-size;
14-
line-height: 20px;
14+
line-height: @tag-line-height;
1515
white-space: nowrap;
1616
background: @tag-default-bg;
1717
border: @border-width-base @border-style-base @border-color-base;
@@ -64,6 +64,7 @@
6464
&-checkable {
6565
background-color: transparent;
6666
border-color: transparent;
67+
cursor: pointer;
6768
&:not(&-checked):hover {
6869
color: @primary-color;
6970
}
@@ -102,5 +103,27 @@
102103
}
103104
}
104105

106+
.make-status-color-classes(@color, @status) {
107+
@lightColor: '@{color}-1';
108+
@lightBorderColor: '@{color}-3';
109+
@darkColor: '@{color}-6';
110+
&-@{status} {
111+
color: @@darkColor;
112+
background: @@lightColor;
113+
border-color: @@lightBorderColor;
114+
}
115+
}
116+
105117
.make-color-classes();
118+
119+
.make-status-color-classes('green', success);
120+
.make-status-color-classes('blue', processing);
121+
.make-status-color-classes('red', error);
122+
.make-status-color-classes('orange', warning);
123+
124+
// To ensure that a space will be placed between character and `Icon`.
125+
> .@{iconfont-css-prefix} + span,
126+
> span + .@{iconfont-css-prefix} {
127+
margin-left: 7px;
128+
}
106129
}

0 commit comments

Comments
 (0)