@import '../style/var';

.vm-switch {
  display: inline-block;
  position: relative;
  width: @switch-width;
  height: @switch-height;
  border: @switch-border;
  border-radius: @switch-node-size;
  box-sizing: content-box;
  background-color: @switch-background-color;
  transition: background-color @switch-transition-duration;

  &::before, &::after {
    font-family: "vm-icon";
    content: "\e645";
    position: absolute;
    color: #fff !important;
    top: 15%;
    left: 10%;
    font-size: 70%;
    line-height: 1em;
    width: 1em;
    text-align: center;
    pointer-events: none;
    transform: scale(0, 0);
    transition: all 0.3s ease-in-out 0s;
  }

  &::before {
    content: "\e646";
    right: 15%;
    transform: scale(1, 1);
    left: auto;
  }

  &-node {
    top: 0;
    left: 0;
    position: absolute;
    border-radius: 100%;
    width: @switch-node-size;
    height: @switch-node-size;
    z-index: @switch-node-z-index;
    transition: @switch-transition-duration;
    box-shadow: @switch-node-box-shadow;
    background-color: @switch-node-background-color;
  }

  &-loading {
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
  }


  &-on {
    background-color: @switch-on-background-color;
    &::after {
      transform: scale(1,1)
    }

    .vm-switch-node {
      transform: translateX(@switch-width - @switch-node-size);
    }
  }

  &-disabled {
    opacity: @switch-disabled-opacity;
  }
}
