@include b(switch) {
  position: relative;
  display: inline-block;
  border: 1px solid $line-color;
  border-radius: 28px;
  background-color: #fff;
  vertical-align: middle;
  cursor: pointer;
  transition: background-color .3s;
  user-select: none;
  &:focus {
    box-shadow: 0 0 0 2px fade($primary-color,20%);
    outline: 0;
  }
  &:focus:hover {
    box-shadow: none;
  }
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 100%;
    background-color: #fff;
    cursor: pointer;
    transition: $transition-time;
    box-shadow: 0 0 4px 0 rgba(0,0,0,.2), 0 4px 23px 0 rgba(0,0,0,.08), -2px 4px 4px 0 rgba(0,0,0,.1);
  }
  &::before {
    content: '';
    z-index: 1;
    position: absolute;
    top: 5px;
    left: 5px;
    display: none;
    border: 1px solid rgba(0,0,0,.1);
    border-color: transparent rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.1);
    border-radius: 50%;
    background-color: transparent;
    animation: fsRotate 1s linear;
    animation-iteration-count: infinite;
  }
  &-checked {
    border-color: $primary-color;
    background-color: $primary-color;
    &::after {
      left: 22px;
    }
    &.#{$namespace}-switch-small::after {
      left: 18px;
    }
    &.#{$namespace}-switch-large::after {
      left: 30px;
    }
  }
  &-loading,
  &-disabled {
    border-color: $disabled-background-color;
    background-color: $disabled-background-color;
    opacity: .6;
    cursor: not-allowed;
    &::after {
      background-color: lighten($disabled-background-color,8);
    }
  }
  &-loading {
    &::before {
      display: block;
    }
  }

  /* small */
  &-small {
    width: 40px;
    height: 22px;
    &::after {
      width: 22px;
      height: 22px;
    }
    &::before {
      width: 10px;
      height: 10px;
    }
  }

  /* normal */
  &-normal {
    width: 50px;
    height: 28px;
    &::after {
      width: 28px;
      height: 28px;
    }
    &::before {
      width: 15px;
      height: 15px;
    }
  }

  /* large */
  &-large {
    width: 60px;
    height: 30px;
    &::after {
      width: 30px;
      height: 30px;
    }
    &::before {
      width: 18px;
      height: 18px;
    }
  }

  /* 自定义文字 */
  &-texted {
    width: auto;
    padding: 0 5px 0 30px;
    .text {
      display: inline-block;
      height: 28px;
      line-height: 28px;
    }
    &.fs-switch-checked {
      padding: 0 30px 0 5px;
      &::after {
        left: 100%;
        transform: translateX(-100%);
      }
    }
  }
}
