@supports
@supports可以判断当前浏览器是否支持css3的属性 支持(与 and, 或 or ,非 not)
/* 判断浏览器是否支持 display:flex; */
@supports (display:flex) {
/* 则干一些事情*/
.login-container .el-input input {
color: red;
}
}
/* and 判断 浏览器支持 ‘-webkit-mask: none’ and(与&&)不支持(not)‘caret-color: $cursor’ */
@supports (-webkit-mask: none) and (not (caret-color: $cursor)) {
/* 则干一些事情*/
.login-container .el-input input {
color: $cursor;
}
}
/* and 判断 浏览器不支持 ‘-webkit-mask: none’ or(或||)支持‘caret-color: $cursor’ */
@supports (not(-webkit-mask: none)) or (caret-color: $cursor) {
/* 则干一些事情*/
.login-container .el-input input {
color: red;
}
}
/* and 判断 浏览器支持 ‘-webkit-mask: none’ not(非!)不支持(not)‘caret-color: $cursor’ */
@supports (-webkit-mask: none) and (not(caret-color: $cursor)) {
/* 则干一些事情*/
.login-container .el-input input {
color: red;
}
}