mixin.scss 2.49 KB
// mixin
// 清除浮动
@mixin clearfix {
  &:after {
    content: '';
    display: table;
    clear: both;
  }
}

// 多行隐藏
@mixin textoverflow($clamp: 1) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  -o-text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: $clamp;
  /*! autoprefixer: ignore next */
  -webkit-box-orient: vertical;
}

//flex box
@mixin flexbox($jc: space-between, $ai: center, $fd: row, $fw: nowrap) {
  display: flex;
  display: -webkit-flex;
  flex: 1;
  justify-content: $jc;
  -webkit-justify-content: $jc;
  align-items: $ai;
  -webkit-align-items: $ai;
  flex-direction: $fd;
  -webkit-flex-direction: $fd;
  flex-wrap: $fw;
  -webkit-flex-wrap: $fw;
}
@mixin cell($fs: 14px, $fw: 400, $margin: 8px 0, $bgc: #fff) {
  background-color: $bgc;
  margin: $margin;
  font-size: $fs;
  font-weight: $fw;
  color: #323233;
  padding: 0 16px;
}
@mixin font($fs: 14px, $fw: 400, $c:#3975c6){
  font-size: $fs;
  font-weight: $fw;
  color: $c;
}
@mixin mainfont($fs: 14px, $fw: 400) {
  @include font($fs,$fw,#3975c6)
}

@mixin darkfont($fs: 14px, $fw: 400, $c: #323233) {
  @include font($fs,$fw,$c)
}
@mixin tit {
  font-size: 18px;
  font-weight: 600;
  padding: 14px 0;
  display: block;
  color: #414143;
}
@mixin textarea{
  .content {
    display: flex;
    flex-direction: column;
    .van-cell {
      &__title {
        flex: 1;
      }
      &__value {
        flex: 0 0 84px;
        margin-top: 12px;
        background: #f7f8fa;
        border-radius: 8px;
      }
    }
  }
}
@mixin recell($mt:8px){
  /deep/.van-cell {
    margin-top: $mt;
    &__title {
      margin-right: 8px;
      flex: 0 0 70px;
    }
    &.l{
      .van-cell__title {
        flex: 0 0 92px;
      }
    }
    &.m{
      .van-cell__title {
        margin-right: 0;
        flex: 0 0 63px;
      }
    }
  }
}
@mixin cellradio {
  @include recell();
  .radio {
    /deep/.van-radio,.van-checkbox {
      flex: 1 1 50%;
      margin: 14px 0 0;
      &:nth-child(1),
      &:nth-child(2) {
        margin-top: 0;
      }
    }
  }
  @include textarea()
}
@mixin btnMain{
  flex: 1;
  height: 40px;
  background-color: $main-color;
  border-radius: 100px;
  @include font(14px,400,#fff);
}
@mixin card{
  display: flex;
  height: 142px;
  background: #fff;
  box-shadow: 0px 2px 12px 0px rgba(100, 101, 102, 0.12);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 8px;
}
@mixin mt($t:5px){
  margin-top: $t;
}
@mixin flexcenter{
  display: flex;
  justify-content: center;
  align-items: center;
}