.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    outline: none;
}

.checkbox {
    position: absolute;
    visibility: hidden;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 5px;
    right: initial;
    bottom: 5px;
    background-color: #fff;
    transition: .4s;
    transition-property: all;
    border-radius: 50%;
}

.checkbox:checked + .switch .slider {
    background-color: #EE4459;
} 

input:checked + .switch .slider:before {
    transform: translateX(20px);
}