@import '../../common/style/press/var.scss';

.press-toast {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: content-box;
  color: var(--toast-text-color, $toast-text-color);
  font-size: var(--toast-font-size, $toast-font-size);
  line-height: var(--toast-line-height, $toast-line-height);

  // allow newline charactor
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-all;
  background-color: var(--toast-background-color, $toast-background-color);
  border-radius: var(--toast-border-radius, $toast-border-radius);

  // 【修改点】此处的 custom-class 在小程序中无效，改为 customStyle
  // &__container {
  //   position: fixed;
  //   top: 50%;
  //   left: 50%;
  //   // hack for avoid max-width when use left & fixed
  //   width: fit-content;
  //   transform: translate(-50%, -50%);
  //   max-width: var(--toast-max-width, $toast-max-width);
  // }

  &--text {
    min-width: var(--toast-text-min-width, $toast-text-min-width);
    padding: var(--toast-text-padding, $toast-text-padding);
    box-sizing: border-box;
  }

  &--icon {
    width: var(--toast-default-width, $toast-default-width);
    min-height: var(--toast-default-min-height, $toast-default-min-height);
    padding: var(--toast-default-padding, $toast-default-padding);

    ::v-deep .press-icon-plus,
    ::v-deep .press-toast__icon {
      font-size: var(--toast-icon-size, $toast-icon-size);
      white-space: normal;
    }

    .press-toast__text {
      padding-top: $padding-xs;
    }
  }

  // 【修改点】此处的custom-class在小程序中无效，改为customStyle
  // &__loading {
  //   margin: 10px 0;
  // }

  &--top {
    transform: translate(0, -30vh);
  }

  &--bottom {
    transform: translate(0, 30vh);
  }
}