/
tag.scss
163 lines (137 loc) · 4.13 KB
/
tag.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
@import "mixins/mixins";
@import "common/var";
@mixin genTheme($backgroundColorWeight, $borderColorWeight, $fontColorWeight, $hoverColorWeight) {
background-color: mix($--tag-primary-color, $--color-white, $backgroundColorWeight);
border-color: mix($--tag-primary-color, $--color-white, $borderColorWeight);
color: mix($--tag-primary-color, $--color-white, $fontColorWeight);
@include when(hit) {
border-color: $--tag-primary-color;
}
.el-tag__close {
color: mix($--tag-primary-color, $--color-white, $fontColorWeight);
&:hover {
color: $--color-white;
background-color: mix($--tag-primary-color, $--color-white, $hoverColorWeight);
}
}
&.el-tag--info {
background-color: mix($--tag-info-color, $--color-white, $backgroundColorWeight);
border-color: mix($--tag-info-color, $--color-white, $borderColorWeight);
color: mix($--tag-info-color, $--color-white, $fontColorWeight);
@include when(hit) {
border-color: $--tag-info-color;
}
.el-tag__close {
color: mix($--tag-info-color, $--color-white, $fontColorWeight);
&:hover {
color: $--color-white;
background-color: mix($--tag-info-color, $--color-white, $hoverColorWeight);
}
}
}
&.el-tag--success {
background-color: mix($--tag-success-color, $--color-white, $backgroundColorWeight);
border-color: mix($--tag-success-color, $--color-white, $borderColorWeight);
color: mix($--tag-success-color, $--color-white, $fontColorWeight);
@include when(hit) {
border-color: $--tag-success-color;
}
.el-tag__close {
color: mix($--tag-success-color, $--color-white, $fontColorWeight);
&:hover {
color: $--color-white;
background-color: mix($--tag-success-color, $--color-white, $hoverColorWeight);
}
}
}
&.el-tag--warning {
background-color: mix($--tag-warning-color, $--color-white, $backgroundColorWeight);
border-color: mix($--tag-warning-color, $--color-white, $borderColorWeight);
color: mix($--tag-warning-color, $--color-white, $fontColorWeight);
@include when(hit) {
border-color: $--tag-warning-color;
}
.el-tag__close {
color: mix($--tag-warning-color, $--color-white, $fontColorWeight);
&:hover {
color: $--color-white;
background-color: mix($--tag-warning-color, $--color-white, $hoverColorWeight);
}
}
}
&.el-tag--danger {
background-color: mix($--tag-danger-color, $--color-white, $backgroundColorWeight);
border-color: mix($--tag-danger-color, $--color-white, $borderColorWeight);
color: mix($--tag-danger-color, $--color-white, $fontColorWeight);
@include when(hit) {
border-color: $--tag-danger-color;
}
.el-tag__close {
color: mix($--tag-danger-color, $--color-white, $fontColorWeight);
&:hover {
color: $--color-white;
background-color: mix($--tag-danger-color, $--color-white, $hoverColorWeight);
}
}
}
}
@include b(tag) {
@include genTheme(10%, 20%, 100%, 100%);
display: inline-block;
height: 32px;
padding: $--tag-padding;
line-height: 30px;
font-size: $--tag-font-size;
color: $--tag-primary-color;
border-width: 1px;
border-style: solid;
border-radius: $--tag-border-radius;
box-sizing: border-box;
white-space: nowrap;
.el-icon-close {
border-radius: 50%;
text-align: center;
position: relative;
cursor: pointer;
font-size: 12px;
height: 16px;
width: 16px;
line-height: 16px;
vertical-align: middle;
top: -1px;
right: -5px;
&::before {
display: block;
}
}
@include m(dark) {
@include genTheme(100%, 100%, 0, 80%);
}
@include m(plain) {
@include genTheme(0, 40%, 100%, 100%);
}
@include m(medium) {
height: 28px;
line-height: 26px;
.el-icon-close {
transform: scale(.8);
}
}
@include m(small) {
height: 24px;
padding: 0 8px;
line-height: 22px;
.el-icon-close {
transform: scale(.8);
}
}
@include m(mini) {
height: 20px;
padding: 0 5px;
line-height: 19px;
.el-icon-close {
margin-left: -3px;
transform: scale(.7);
}
}
}