@import "mixins/mixins";
@import "mixins/utils";
@import "common/var";

@include b(alert) {
  width: 100%;
  font-size: $--alert-text-font-size;
  padding: $--alert-padding;
  margin: 0;
  box-sizing: border-box;
  border-radius: $--alert-border-radius;
  position: relative;
  overflow: hidden;
  opacity: 1;
  display: flex;
  align-items: flex-start;
  transition: opacity .2s;
  border: 1px solid;

  @include when(center) {
    justify-content: center;
  }

  @include when(bg) {
    background-color: transparent;
    border: none;
  }

  @include when(description) {
    padding: $--alert-padding-desc;
    .el-alert__close-icon {
      top: 17px!important;
    }
    // 文字按钮
    .is-customed{
      top: 22px;
    }
  }

  @include m(success) {
    background-color: $--alert-success-bg--color;
    border-color: $--alert-success-border--color;

    .el-alert__icon {
      color: $--alert-success-icon--color;
    }

    .el-alert__content {
      color: $--alert-font--color;
    }
  }

  @include m(info) {
    background-color: $--alert-info-bg--color;
    border-color: $--alert-info-border--color;

    .el-alert__icon {
      color: $--alert-info-icon--color;
    }
    .el-alert__content {
      color: $--alert-font--color;
    }
  }

  @include m(warning) {
    background-color: $--alert-warning-bg--color;
    border-color: $--alert-warning-border--color;

    .el-alert__icon {
      color: $--alert-warning-icon--color;
    }
    .el-alert__content {
      color: $--alert-font--color;
    }
  }

  @include m(error) {
    background-color: $--alert-danger-bg--color;
    border-color: $--alert-danger-border--color;

    .el-alert__icon {
      color: $--alert-danger-icon--color;
    }
    .el-alert__content {
      color: $--alert-font--color;
    }
  }

  @include e(content) {
    display: table-cell;
    padding: 0 40px 0 0;
    @include when(big) {
      padding-left: 16px;
      padding-right: 60px;
    }
  }

  @include e(icon) {
    font-size: $--alert-icon-size;
    width: $--alert-icon-size;
    height: $--alert-icon-size;
    margin-right: 10px;

    @include when(big) {
      position: absolute;
      top: 17px;
      left: 20px;
    }
  }

  @include e(title) {
    font-size: $--alert-text-font-size;
    line-height: $--alert-icon-size;
    @include when(bold) {
      font-size: $--alert-title-font-size;
      font-weight: 500;
      line-height: 20px;
    }
  }

  & .el-alert__description {
    font-size: $--alert-text-font-size;
    margin: 4px 0 0;
    color: $--alert-font--color;
  }

  @include e(close-icon){
    @include close-btn(10px, 0, 14px, 10px, 9px);
    @include trans-peudo-class-color($--alert-closebtn--color, $--alert-closebtn--color)
  }

  @include e(closebtn) {
    position: absolute;
    right: 10px;
    top: 14px;
    transform: translateY(-50%);
    cursor: pointer;

    @include when(big) {
      font-size: 17px;
      top: 50%;

      &.el-alert__close-icon{
        @include close-btn(14px, 0, 50%, 10px, 12px);
      }
    }
    // 文字  知道了
    @include when(customed) {
      font-style: normal;
      color: $--alert-closebtn--color;
      font-size: $--alert-text-font-size;
      top: 14px;
    }
  }
}

.el-alert-fade-enter,
.el-alert-fade-leave-active {
  opacity: 0;
}
