<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

<div class="main">
  <h1>
    <a href="https://github.com/mahazz/Vue-Toggle" target="_blank">
      Toggle
      <i class="toggle fa-github-square"></i>
    </a>
  </h1>
  <label class="switch">
    <input checked type="checkbox" />
    <span class="slider round"></span>
    <h6>On (checked)</h6>
  </label>
  <label class="switch">
    <input type="checkbox" />
    <span class="slider round"></span>
    <h6>Off (checked)</h6>
  </label>
  <div class="disabled-toggle">
    <label class="switch">
      <input checked disabled type="checkbox" />
      <span class="slider round"></span>
      <h6>Off (disabled)</h6>
    </label>
    <label class="switch">
      <input disabled type="checkbox" />
      <span class="slider round"></span>
      <h6>On (disabled)</h6>
    </label>
  </div>
  <label class="switch">
    <input checked type="checkbox" />
    <span class="slider round w-color"></span>
    <h6>Custom toggle</h6>
  </label>
  <label class="switch">
    <input checked type="checkbox" />
    <span class="slider round icon"></span>
    <h6>Toggle & icons</h6>
  </label>
  <p class="dev-footer">
    Developed by
    <a href="https://github.com/mahazz/" target="_blank">Maha Alzahrani</a>
  </p>
</div>
*,
*:after,
*:before {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  height: 100%;
  background-color: #ebdb52;
  font-family: "Raleway", Arial, sans-serif;
  margin: 0px;
}

#app {
  height: 100%;
}
.main {
  height: 100%;
  padding: 3em 2em;
  text-align: center;
  overflow: auto;
}
h1 {
  font-weight: 800;
  font-size: 3.75em;
  color: #495464;
}
h3 {
  margin: 40px 0 0;
}
h6 {
  font-size: 15px;
  color: gray;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #4e4a46;
  text-decoration: none;

  &:hover,
  &:focus {
    color: #7e628f;
  }
}
p {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  margin: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}
input:checked + .icon::before {
  font-family: "FontAwesome";
  content: "\f00c";
  transform: rotate(45deg);
  padding-top: 5px;
}
.toggle {
  font-family: "FontAwesome";
  font-style: normal !important;
}
.dev-footer {
  margin-top: 71px;
  color: #4e4a46;
}
input + .icon::before {
  font-family: "FontAwesome";
  content: "\f00d";
  padding-top: 5px;
}
.slider.w-color:before {
  background-color: #a37eba;
}
.slider.w-color {
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}
input:checked + .slider.w-color {
  background-color: #ccc;
}
input:checked + .slider.icon {
  background-color: #a37eba;
}

.slider.icon:before {
  background-color: #ffe05d;
}
.slider.icon:after {
  background-color: #e2df23;
}
input:checked + .slider {
  background-color: #2196f3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}
.disabled-toggle {
  opacity: 0.5;
  cursor: default;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.