@import '../../constants/colors';

.toggle-wrapper {
  cursor: pointer;
  display: flex;
  align-items: center;

  /* The switch - the box around the slider */
  &[role='checkbox'] > .switch {
    flex-shrink: 0;
    position: relative;
    display: inline-block;
    width: 35px;
    height: 20px;
  }

  &[aria-checked='true'] > .switch > .slider {
    background-color: $blue;
    border-color: transparent;

    &:before {
      background-color: #fff;
      -webkit-transform: translateX(14px);
      -ms-transform: translateX(14px);
      transform: translateX(14px);
    }
  }

  /* The slider */
  .slider {
    border-radius: 34px;
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #ccc;
    -webkit-transition: 0.15s;
    transition: 0.15s;

    &:before {
      border-radius: 50%;
      position: absolute;
      content: '';
      height: 12px;
      width: 12px;
      left: 2px;
      bottom: 2px;
      background-color: #ccc;
      -webkit-transition: 0.15s;
      transition: 0.15s;
    }
  }

  label {
    margin-left: 5px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
  }
}
