@import './common/var.css';

.van-switch {
  height: 33px;
  width: 53px;
  display: inline-block;
  position: relative;
  background: $white;
  border-radius: 16px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 32px;

  &__node {
    width: 30px;
    height: 30px;
    border-radius: 13.5px;
    background-color: $white;
    position: absolute;
    box-shadow: 0 3px 1px 0 rgba(0, 0, 0, .05), 0 2px 2px 0 rgba(0, 0, 0, .1), 0 3px 3px 0 rgba(0, 0, 0, .05);
    left: 0;
    top: 0;
    z-index: 2;
    transition: transform .3s;

    &::after {
      border-color: rgba(0, 0, 0, .1);
      border-radius: 27px;
    }
  }

  &__loading {
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translate3d(-50%, -50%, 0);
  }

  &--on {
    background-color: #44db5e;

    &::after {
      border-color: #44db5e;
    }

    .van-switch__node {
      transform: translateX(21px);
    }
  }

  &--off {
    background-color: $white;
    border-color: rgba(0, 0, 0, .1);
  }

  &--disabled {
    opacity: .4;
  }
}
