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

@include b(alert) {
  width: 100%;
  padding: $--alert-padding;
  /* padding-right:20px; */
  margin: 0;
  box-sizing: border-box;
  border-radius: $--alert-border-radius;
  position: relative;
  background-color: $--color-white;
  overflow: hidden;
  opacity: 1;
  display: flex;
  align-items: top;
  transition: opacity .2s;
  color: $--color-text-primary;
  // .el-alert__description {
  //   color: $--color-text-primary;
  // }

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

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

    .el-alert__icon {
      color: $--color-success-hover;
    }

    .el-alert__closebtn {
      color: $--color-success-active;
    }
    
    p {
      color: $--color-success-active;
    }
  }
  @include m(tip) {
    background-color: $--color-info-bg;
    color: $--color-nav;

    .el-alert__icon {
      color: $--color-primary;
    }
    .el-alert__closebtn {
      color: $--color-nav;
    }
    p {
      color: $--color-info-active;
    }
  }
  @include m(info) {
    background-color: $--color-info-secondary-bg;
    color: $--color-info-secondary-active;

    .el-alert__icon {
      color: $--color-info-secondary-hover;
    }
    .el-alert__closebtn {
      color: $--color-info-secondary-active;
    }
    p {
      color: $--color-info-active;
    }
  }

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

    .el-alert__icon {
      color: $--color-warning-hover;
    }
    .el-alert__closebtn {
      color: $--color-warning-active;
    }
    p {
      color: $--color-warning-active;
    }
  }
  
  @include m(error) {
    background-color: $--color-danger-bg;
    color: $--color-danger-active;

    .el-alert__icon {
      color: $--color-danger-hover;
    }
    .el-alert__closebtn {
      color: $--color-danger-active;
    }
    p {
      color: $--color-danger-active;
    }
  }
  @include m(nobg) {
    background:none;
    padding-left:0;
    color: $--color-text-primary;
  }
  @include e(content) {
    display: table-cell;
    line-height:16px;
    padding-right: 12px;
    /* padding: 0 5px;
    line-height: 20px; */
  }

  @include e(icon) {
    font-size: $--alert-icon-size;
    width: $--alert-icon-size;
    /* line-height: 20px; */
    margin-right:5px;
    @include when(big) {
      font-size: $--alert-icon-large-size;
      width: $--alert-icon-large-size;
      margin-top:8px;
    }
  }

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

  & .el-alert__description {
    font-size: $--alert-description-font-size;
    margin: 5px 0 0 0;
  }

  @include e(closebtn) {
    font-size: $--alert-close-font-size;
    // color: $--color-info;
    opacity: 1;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;

    @include when(customed) {
      font-style: normal;
      font-size: $--alert-close-customed-font-size;
      top: 11px;
    }
  }
}

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