@import 'mixins/mixins';
@import 'common/var';
@import 'descriptions-item';

@include b(descriptions) {
  box-sizing: border-box;
  font-size: $--font-size-base;
  color: $--color-text-primary;

  @include e(header) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: $--descriptions-header-margin-bottom;

    @include e(title) {
      font-size: $--descriptions-title-font-size;
      font-weight: $--font-weight-strengthen;
    }
  }

  .el-descriptions__body {
    color: $--color-text-primary;
    background-color: $--color-white;

    table {
      border-collapse: collapse;
      width: 100%;
      table-layout: fixed;

      th, td {
        box-sizing: border-box;
        line-height: 23px;

        @include when(left) {
          text-align: left;
        }

        @include when(center) {
          text-align: center;
        }

        @include when(right) {
          text-align: right;
        }
      }
    }
  }

  .is-bordered {
    table-layout: auto;
    th, td {
      border: $--descriptions-table-border;
      padding: 8px 10px;
    }
  }

  :not(.is-bordered) {
    th, td {
      padding-bottom: 8px;
    }
  }

  @include m(medium) {
    &.is-bordered {
      th, td {
        padding:6px 10px;
      }
    }

    &:not(.is-bordered) {
      th, td {
        padding-bottom: 6px;
      }
    }
  }

  @include m(small) {
    font-size: 12px;
    &.is-bordered {
      th, td {
        padding: 4px 10px;
      }
    }

    &:not(.is-bordered) {
      th, td {
        padding-bottom: 4px;
      }
    }
  }

  @include m(mini) {
    font-size: 12px;

    &.is-bordered {
      th, td {
        padding: 2px 10px;
      }
    }

    &:not(.is-bordered) {
      th, td {
        padding-bottom: 2px;
      }
    }
  }
}