.toggleRow {
display: flex;
align-items: center;
justify-content: space-between;
margin: 20px 0;
font-size: 18px;
}
.toggle {
position: relative;
display: inline-block;
width: 48px;
height: 24px;
margin: 0;
}
.toggleInput {
opacity: 0;
width: 0;
height: 0;
}
.toggleSlider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #4b5cd2;
-webkit-transition: .4s;
transition: .4s;
border-radius: 50px;
}
.toggleSlider::before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background-color: #fff;
border-radius: 50%;
}
.toggle input:checked + .toggleSlider {
background-color: #4bd4bb;
}
.toggle input:checked + .toggleSlider:before {
-webkit-transform: translateX(24px);
-ms-transform: translateX(24px);
transform: translateX(24px);
}
.toggleSlider:before {
transition-timing-function: ease-in;
-webkit-transition: .4s;
transition: .4s;
}
view raw toggleRow.module.css hosted with ❤ by GitHub