/**
 *
 * This file may have been modified by Bytedance Inc. (“Bytedance Inc.'s Modifications”). 
 * All Bytedance Inc.'s Modifications are Copyright (year) Bytedance Inc..  
 * 
 * This source code is licensed under the Apache license.
 * See LICENSE file in the project root for license information.
 *
 */
@switch-prefix-cls: ~'@{ant-prefix}-switch';
.@{switch-prefix-cls} {
  // 取消动画
  box-shadow: none !important;
  .@{ant-prefix}-click-animating-node {
    display: none;
  }
  .@{switch-prefix-cls}-loading-icon {
    vertical-align: top;
  }
  // 普通状态的颜色
  &:not(.@{switch-prefix-cls}-checked) {
    background-color: @switch-base-bg;
    &.@{switch-prefix-cls}-disabled,
    &.@{switch-prefix-cls}-loading {
      opacity: 1;
      background-color: @switch-disabled-base-bg;
      .@{switch-prefix-cls}-inner {
        color: @switch-disabled-base-color;
      }
    }
    .@{switch-prefix-cls}-inner {
      color: @switch-base-color;
    }
    .@{switch-prefix-cls}-loading-icon {
      color: @switch-loading-color;
    }
  }
  // 普通状态的字号
  &:not(.@{switch-prefix-cls}-small) {
    .@{switch-prefix-cls}-inner {
      font-size: @font-size-base;
    }
  }
  // handle 阴影
  .@{switch-prefix-cls}-handle {
    &::before {
      box-shadow: @switch-handle-shadow;
    }
  }
  // disabled 不显示滑块阴影
  &.@{switch-prefix-cls}-disabled {
    .@{switch-prefix-cls}-handle::before {
      box-shadow: none;
    }
  }
  // 小尺寸的圆位置
  &.@{switch-prefix-cls}-small {
    &.@{switch-prefix-cls}-checked {
      .@{switch-prefix-cls}-handle {
        left: calc(100% - @switch-sm-pin-size - @switch-sm-padding);
      }
    }
    .@{switch-prefix-cls}-handle {
      top: @switch-sm-padding;
      left: @switch-sm-padding;
    }
  }

  &-loading,
  &-disabled {
    background-color: @switch-checked-disabled-bg;
  }

  &-loading,
  &-checked,
  &-disabled {
    .@{switch-prefix-cls}-loading-icon {
      color: @switch-checked-disabled-bg;
    }
  }
}
