input[type="checkbox"] {
  position: relative;
  width: 35px;
  height: 15px;
  visibility: hidden;
  margin: 8px 5px 0 0;
}
input[type="checkbox"]:before {
  visibility: visible;
  position: absolute;
  display: block;
  width: 100%;
  height: 20px;
  top: 0;
  background: #fff;
  content: '';
  border-radius: 10px;
  border: solid 1px #ddd;
  transition: all .2s;
}
input[type="checkbox"]:after {
  visibility: visible;
  top: 0;
  display: block;
  content: '';
  width: 20px;
  height: 20px;
  background: #fff;
  position: absolute;
  border-radius: 50%;
  border: solid 1px #ddd;
  transition: all .2s;
  left: 0;
}
input[type="checkbox"]:checked:after {
  left: 100%;
  margin-left: -20px;
}
input[type="checkbox"]:checked:before {
  background: #2ecc71;
}
input[type="checkbox"].square {
  width: 60px;
}
input[type="checkbox"].square:before {
  border-radius: 2px;
}
input[type="checkbox"].square:after {
  border-radius: 2px;
  width: 30px;
}
input[type="checkbox"].square:checked:after {
  left: 100%;
  margin-left: -30px;
}
input[type="checkbox"].square:checked:before {
  background: #3498db;
}