element-plus的样式中本身就带有!important ,如何更改?
.el-select .el-input.is-focus .el-input__wrapper {
box-shadow: 0 0 0 1px var(--el-select-input-focus-border-color) inset!important;
}
上面这段代码 是elementPlus本身就有的! important
它展示的效果是:el-select的下拉 鼠标右键的时候,上面的select就会有一个border
我的需求是,不要有这个border 啦。
因为.el-select .el-input.is-focus .el-input__wrapper 应该是全局的,将dom限制再一个className(typeDataDom)里面,利用class的局限性,控制下方的dom样式。
改法:
.typeDataDom{
float: left;
:deep(.el-input__wrapper){
border: 0px;
background-color: transparent;
border-radius: 4.5px;
padding-left: 10px;
font-size: 20px;
color: #000000;
font-weight: 500;
box-shadow: unset !important;
}
:deep(.el-select .el-input.is-focus .el-input__wrapper){
box-shadow: unset !important; // 这里
}
}
不是不提倡用!important么?令我惊讶的是 elementPlus里面竟然也用。