.switch {
position: relative;
display: inline-block;
width: 150px;
height: 48px;
border: 2px solid #ddd;
border-radius: 8px;
overflow: hidden;
}

.switch .color {
display: none;
position: absolute;
top: 50%;
transform: translate(0, -50%);
transition: .2s;
cursor: pointer;
font-weight: 700;
font-size: .8em;
z-index: 10;
}

.switch .black {
color: #fff;
left: 12px;
}

.switch .white {
color: #000;
right: 12px;
}

/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
}

/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #fff;
transition: .2s;
}

.slider:before {
position: absolute;
content: "";
height: 36px;
width: 36px;
left: 5px;
bottom: 4px;
background-color: #888;
transition: .2s;
border-radius: 4px;
}

input:checked + .slider {
background-color: #000;
}

input:focus + .slider {
__box-shadow: 0 0 1px #000;
}

input:checked + .slider:before {
transform: translateX(100px);
}

/* Rounded sliders */
.slider.round {
border-radius: 34px;
}

.slider.round:before {
border-radius: 50%;
} 