59 lines
868 B
SCSS
59 lines
868 B
SCSS
/* The switch - the box around the slider */
|
|
.switch {
|
|
position: relative;
|
|
display: inline-block;
|
|
width: 60px;
|
|
height: 34px;
|
|
|
|
/* Hide default HTML checkbox */
|
|
input {
|
|
width: 0;
|
|
height: 0;
|
|
opacity: 0;
|
|
}
|
|
}
|
|
|
|
/* The slider */
|
|
.slider {
|
|
position: absolute;
|
|
background-color: #ccc;
|
|
cursor: pointer;
|
|
inset: 0;
|
|
transition: 0.4s;
|
|
|
|
&::before {
|
|
position: absolute;
|
|
bottom: 4px;
|
|
left: 4px;
|
|
width: 26px;
|
|
height: 26px;
|
|
background-color: #fff;
|
|
content: '';
|
|
transition: 0.4s;
|
|
}
|
|
}
|
|
|
|
input:checked + .slider {
|
|
background-color: #2196f3;
|
|
}
|
|
|
|
input:focus + .slider {
|
|
box-shadow: 0 0 1px #2196f3;
|
|
}
|
|
|
|
input:checked + .slider::before {
|
|
transform: translateX(26px);
|
|
}
|
|
|
|
/* Rounded sliders */
|
|
.slider.round {
|
|
border-radius: 34px;
|
|
}
|
|
|
|
.slider.round::before {
|
|
border-radius: 50%;
|
|
}
|
|
|
|
.inco-data {
|
|
height: initial;
|
|
}
|