@import '../var.less';

.f-switch {
  display: inline-block;
  box-sizing: border-box;
  position: relative;
  cursor: pointer;

  width: 28px;
  height: 16px;
  padding: 2px;
  border-radius: 10px;

  .f-switch-core {
    display: inline-block;
    position: absolute;
    transition: left 200ms;

    background: #fff;

    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
  }
}

.f-switch-active {
  background: @primary-color;

  .f-switch-core {
    left: calc(100% - 12px - 2px);
  }
}

.f-switch-inactive {
  background: @gray-20;

  .f-switch-core {
    left: 2px;
  }
}

.f-switch-disabled {
  cursor: not-allowed;
}

.f-switch-active-disabled {
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)), #2889e3;
}

.f-switch-inactive-disabled {
  background: @gray-10;
}
