// flex适配
.flex {
display: flex;
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
}
.flex-direction_column {
-webkit-box-orient: vertical;
-ms-flex-direction: column;
-webkit-flex-direction: column;
flex-direction: column;
}
.justify-content_flex-center {
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.justify-content_flex-end {
-webkit-box-pack: end;
-ms-flex-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.justify-content_flex-justify {
-webkit-box-pack: justify;
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.align-items_flex-start {
-webkit-box-align: start;
-ms-flex-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
}
.align-items_flex-end {
-webkit-box-align: end;
-ms-flex-align: end;
-webkit-align-items: flex-end;
align-items: flex-end;
}
.align-items_center {
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
.align-items_baseline {
-webkit-box-align: baseline;
-ms-flex-align: baseline;
-webkit-align-items: baseline;
align-items: baseline;
}
.flex_auto {
-webkit-box-flex: 1;
-ms-flex: auto;
-webkit-flex: auto;
flex: auto;
}
.flex_1 {
width: 0;
-webkit-box-flex: 1;
-ms-flex: 1;
-webkit-flex: 1;
flex: 1;
}
.order_2 {
-webkit-box-ordinal-group: 2;
-ms-flex-order: 2;
-webkit-order: 2;
order: 2;
}
.order_3 {
-webkit-box-ordinal-group: 3;
-ms-flex-order: 3;
-webkit-order: 3;
order: 3;
}
// 计算
.heightcalc(@val) {
height: -moz-calc(~'@{val}') !important;
height: -webkit-calc(~'@{val}') !important;
height: calc(~'@{val}') !important;
}
.mainheight(@val) {
height: calc(~'@{val}' - @headerheight) !important;
}
.widthcalc(@val) {
width: -moz-calc(~'@{val}') !important;
width: -webkit-calc(~'@{val}') !important;
width: calc(~'@{val}') !important;
}
.maxheightcalc(@val) {
max-height: -moz-calc(~'@{val}') !important;
max-height: -webkit-calc(~'@{val}') !important;
max-height: calc(~'@{val}') !important;
}
// 隐藏滚动条
.hide_scrollbar {
-ms-overflow-style: none; // ie 10+
scrollbar-width: none; // firefox
// chrome 和Safari
&::-webkit-scrollbar {
height: 0 !important;
}
}
// 单行省略
.text_line {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.text-lines(@lineNum) {
display: -webkit-box;
// autoprefixer: ignore next;
-webkit-box-orient: vertical;
-webkit-line-clamp: @lineNum;
overflow: hidden;
text-overflow: ellipsis;
}
// IOS滑动
.iosscroll {
-webkit-overflow-scrolling: touch; // IOS
&::-webkit-scrollbar {
display: none;
}
}