@import './var.less';

:root {
  --van-progress-height: @progress-height;
  --van-progress-large-height: @progress-large-height;
  --van-progress-color: @progress-color;
  --van-progress-inactive-color: @progress-inactive-color;
  --van-progress-background-color: @progress-background-color;
  --van-progress-pivot-padding: @progress-pivot-padding;
  --van-progress-pivot-text-color: var(--van-progress-pivot-background-color);
  --van-progress-pivot-font-size: @progress-pivot-font-size;
  --van-progress-large-pivot-font-size: @progress-large-pivot-font-size;
  --van-progress-pivot-line-height: @progress-pivot-line-height;
  --van-progress-pivot-background-color: @progress-pivot-background-color;
  --van-progress-text-gap: @progress-text-gap;
}

.van-progress {
  display: flex;
  align-items: center;
  gap: var(--van-progress-text-gap);

  &--large {
    --van-progress-height: var(--van-progress-large-height);
    --van-progress-pivot-font-size: var(--van-progress-large-pivot-font-size);
  }

  &__track {
    position: relative;
    flex: 1;
    height: var(--van-progress-height);
    overflow: hidden;
    background: var(--van-progress-background-color);
    border-radius: var(--van-border-radius-max);
  }

  &__portion {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--van-progress-color);
    border-radius: var(--van-border-radius-max);
    transform-origin: 0;
    transition: all var(--van-animation-duration-base)
      var(--van-animation-timing-function-enter);

    &--inactive {
      background: var(--van-progress-inactive-color);
    }
  }

  &__pivot {
    flex: none;
    box-sizing: border-box;
    padding: var(--van-progress-pivot-padding);
    color: var(--van-progress-pivot-text-color);
    font-size: var(--van-progress-pivot-font-size);
    line-height: var(--van-progress-pivot-line-height);
    text-align: center;
    word-break: keep-all;

    &--inactive {
      color: var(--van-progress-inactive-color);
    }
  }
}
