.nut-theme-dark {
  .nut-switch {
    background-color: $dark4;

    &.switch-close {
      color: $dark1;
    }

    .switch-button {
      .close {
        color: $dark4;
      }
    }
  }
}

.nut-switch {
  cursor: pointer;
  display: flex;
  align-items: center;
  background-color: $primary-color;
  border-radius: $switch-border-radius;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center center;
  flex: 0 0 auto; // 防止被压缩

  &.switch-close {
    background-color: $switch-close-bg-color;

    .close-line {
      background: $switch-close--line-bg-color;
      border-radius: 2px;
    }
  }

  .switch-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: $primary-text-color;
    transition: transform 0.3s;

    .nut-switch__label {
      color: $primary-text-color;
      font-size: $font-size-1;

      &.open {
        transform: translateX(-16px);
      }

      &.close {
        transform: translateX(16px);
      }
    }
  }

  &-disable {
    opacity: 0.6;
  }

  &-base {
    width: $switch-width;
    height: $switch-height;
    line-height: $switch-line-height;

    .switch-button {
      height: $switch-inside-height;
      width: $switch-inside-width;
      transform: $switch-inside-close-transform;
    }

    &.switch-open {
      .switch-button {
        transform: $switch-inside-open-transform;
      }
    }

    &.switch-close {
      .close-line {
        width: 8px;
        height: 2px;
      }
    }
  }
}
