.switch {
    display: block;
    margin: 0;
  }
  .switch input[type=checkbox] {
    display: none;
  }
  .switch input[type=checkbox]:checked + label {
    background-color: #55c946;
  }
  .switch input[type=checkbox]:checked + label:after {
    left: 27px;
  }
  .switch label {
    transition: all 200ms ease-in-out;
    display: inline-block;
    position: relative;
    height: 24px;
    width: 48px;
    border-radius: 40px;
    cursor: pointer;
    background-color: #ddd;
    color: transparent;
  }
  .switch label:after {
    transition: all 200ms ease-in-out;
    content: " ";
    position: absolute;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background-color: white;
    top: 3px;
    left: 3px;
    right: auto;
  }
  .switch.colored input[type=checkbox]:checked + label {
    background-color: #55c946;
  }
  .switch.colored label {
    background-color: #ff4949;
  }