Commit fef57145 by Jaxon

style(scss): 添加圆点工具类并自定义ElementUI标签组件样式

1 parent a492b18b
.el-table .el-tag,
.el-tag {
display: inline-block;
height: 32px;
padding: 0 10px;
line-height: 30px;
font-size: 12px;
color: #2a58ad;
border-width: 1px;
border-style: solid;
border-radius: 4px;
box-sizing: border-box;
white-space: nowrap;
width: auto;
.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;
}
}
&.el-tag--primary {
background-color: #53a8ff;
border-color: #66b1ff;
color: #2a58ad;
.el-icon-close {
color: #2a58ad;
&:hover {
color: #fff;
background-color: #2a58ad;
}
}
}
&.el-tag--success {
background-color: #85ce61;
border-color: #8ed573;
color: #2cca74;
.el-icon-close {
color: #2cca74;
&:hover {
color: #fff;
background-color: #2cca74;
}
}
}
&.el-tag--warning {
background-color: #fdf6ec;
border-color: #f2c87d;
color: #fdb757;
.el-icon-close {
color: #fdb757;
&:hover {
color: #fff;
background-color: #fdb757;
}
}
}
&.el-tag--danger {
background-color: #fef0f0;
border-color: #f96c6c;
color: #eb4e4e;
.el-icon-close {
color: #eb4e4e;
&:hover {
color: #fff;
background-color: #eb4e4e;
}
}
}
&.el-tag--info {
background-color: #f4f4f5;
border-color: #b1b4b8 !important;
color: #909399;
.el-icon-close {
color: #909399;
&:hover {
color: #fff;
background-color: #c6c8cc;
}
}
}
&.el-tag--dark {
&.el-tag--primary {
background-color: #2a58ad;
border-color: #2a58ad;
color: #fff;
.el-icon-close {
color: #fff;
&:hover {
background-color: #66b1ff;
}
}
}
&.el-tag--success {
background-color: #2cca74;
border-color: #2cca74;
color: #fff;
.el-icon-close {
color: #fff;
&:hover {
background-color: #85ce61;
}
}
}
&.el-tag--warning {
background-color: #fdb757;
border-color: #fdb757;
color: #fff;
.el-icon-close {
color: #fff;
&:hover {
background-color: #f0c36d;
}
}
}
&.el-tag--danger {
background-color: #eb4e4e;
border-color: #eb4e4e;
color: #fff;
.el-icon-close {
color: #fff;
&:hover {
background-color: #f78989;
}
}
}
&.el-tag--info {
background-color: #c6c8cc;
border-color: #c6c8cc;
color: #fff;
.el-icon-close {
color: #fff;
&:hover {
background-color: #a6a9ad;
}
}
}
}
&.el-tag--plain {
&.el-tag--primary {
background-color: transparent;
border-color: #79bbff;
color: #2a58ad;
.el-icon-close {
color: #2a58ad;
&:hover {
color: #fff;
background-color: #2a58ad;
}
}
}
&.el-tag--success {
background-color: transparent;
border-color: #a0d89a;
color: #2cca74;
.el-icon-close {
color: #2cca74;
&:hover {
color: #fff;
background-color: #2cca74;
}
}
}
&.el-tag--warning {
background-color: transparent;
border-color: #ebb778;
color: #fdb757;
.el-icon-close {
color: #fdb757;
&:hover {
color: #fff;
background-color: #fdb757;
}
}
}
&.el-tag--danger {
background-color: transparent;
border-color: #f9a8a8;
color: #eb4e4e;
.el-icon-close {
color: #eb4e4e;
&:hover {
color: #fff;
background-color: #eb4e4e;
}
}
}
&.el-tag--info {
background-color: transparent;
border-color: #c0c4cc;
color: #c6c8cc;
.el-icon-close {
color: #c6c8cc;
&:hover {
color: #fff;
background-color: #c6c8cc;
}
}
}
}
&.el-tag--medium {
height: 28px;
line-height: 26px;
.el-icon-close {
transform: scale(0.8);
}
}
&.el-tag--small {
height: 24px;
padding: 0 8px;
line-height: 22px;
.el-icon-close {
transform: scale(0.8);
}
}
&.el-tag--mini {
height: 20px;
padding: 0 5px;
line-height: 19px;
.el-icon-close {
margin-left: -3px;
transform: scale(0.7);
}
}
&.is-hit {
border-color: currentColor;
}
}
...@@ -8,6 +8,34 @@ $prefix: d2; ...@@ -8,6 +8,34 @@ $prefix: d2;
user-select: none; user-select: none;
cursor: pointer; cursor: pointer;
} }
@mixin dotBase {
position: relative;
padding-left: 12px;
&::before {
content: "";
position: absolute;
width: 6px;
height: 6px;
border-radius: 50%;
top: 50%;
left: 0;
transform: translate(0, -50%);
}
}
.green-dot {
@include dotBase();
&::before {
background: #2cca74;
}
}
.yellow-dot {
@include dotBase();
&::before {
background: #fdb757;
}
}
// 填满父元素 // 填满父元素
// 组要父元素 position: relative | absolute; // 组要父元素 position: relative | absolute;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!