.#{$switch-prefix-cls} {
  position: relative;
  display: inline-block;
  vertical-align: middle;

  &__inner {
    position: relative;
    width: $switch-width;
    height: $switch-height;
    background: $gray-5;
    border-radius: $switch-height;
    transition: all 300ms;

    &::before,
    &::after{
      position: absolute;
      content: "";
    }

    &::before {
      right: 0;
      left: 0;
      z-index: 1;
      width: 100%;
      height: 100%;
      background: $gray-5;
      border-radius: $switch-height;
      transition: all 200ms;
      transform: scale(1);
    }

    &::after {
      top: $switch-trigger-spacer;
      left: $switch-trigger-spacer;
      z-index: 2;
      width: $switch-height - $switch-trigger-spacer*2;
      height: $switch-height - $switch-trigger-spacer*2;
      background: $white;
      border-radius: $switch-height - $switch-trigger-spacer*2;
      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);
      transition: all 200ms;
    }
  }

  input[type="checkbox"] {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    border: 0 none;
    opacity: 0;
    appearance: none;

    &:checked {
      & + .#{$switch-prefix-cls}__inner {
        background: $brand-primary;

        &::before {
          transform: scale(0);
        }

        &::after {
          left: 100%;
          margin-left: -($switch-height - $switch-trigger-spacer*2 + $switch-trigger-spacer);
        }
      }
    }
  }

  @include status-disabled;

}
