$prefix-cls: "nature-design";
$switch-prefix-cls: '#{$prefix-cls}-switch';
$switch-duration: .36s;
$font-size-base: 12px;
$component-background: #fff ;
$ease-in-out-circ: cubic-bezier(0.78, 0.14, 0.15, 0.86);


.#{$switch-prefix-cls} {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  height: 22px;
  min-width: 44px;
  line-height: 20px;
  vertical-align: middle;
  border-radius: 20px;
  border: 1px solid transparent;
  background-color: rgba(0,0,0,.25);
  cursor: pointer;
  transition: all $switch-duration;
  user-select: none;

  &-inner {
    color: #fff;
    font-size: $font-size-base;
    margin-left: 24px;
    margin-right: 6px;
    display: block;
  }

  &:after {
    position: absolute;
    width: 18px;
    height: 18px;
    left: 1px;
    top: 1px;
    border-radius: 18px;
    background-color: $component-background;
    content: " ";
    cursor: pointer;
    transition: all $switch-duration $ease-in-out-circ;
  }

  &:active:after {
    width: 24px;
  }

  &:focus {
    box-shadow: 0 0 0 2px rgba(16,142,233,.2);
    outline: 0;
  }

  &:focus:hover {
    box-shadow: none;
  }

  &-small {
    height: 14px;
    min-width: 28px;
    line-height: 12px;

    .#{$switch-prefix-cls}-inner {
      margin-left: 18px;
      margin-right: 3px;
    }

    &:after {
      width: 12px;
      height: 12px;
      top: 0;
      left: 0.5px;
    }

    &:active:after {
      width: 16px;
    }
  }

  &-small.#{$switch-prefix-cls}-checked {
    &:after {
      left: 100%;
      margin-left: -12.5px;
    }

    .#{$switch-prefix-cls}-inner {
      margin-left: 3px;
      margin-right: 18px;
    }
  }

  &-small:active.#{$switch-prefix-cls}-checked:after {
    margin-left: -16.5px;
  }

  &-checked {
    background-color: #108ee9;

    .#{$switch-prefix-cls}-inner {
      margin-left: 6px;
      margin-right: 24px;
    }

    &:after {
      left: 100%;
      margin-left: -19px;
    }

    &:active:after {
      margin-left: -25px;
    }
  }

  &-disabled {
    cursor: not-allowed;
    background: #f4f4f4;

    &:after {
      background: #ccc;
      cursor: not-allowed;
    }

    .#{$switch-prefix-cls}-inner {
      color: rgba(0,0,0,.25);
    }
  }
}
