You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
993 B
52 lines
993 B
// *, *:after, *:before { |
|
// // box-sizing: border-box; |
|
// } |
|
|
|
// body { |
|
// min-height: 100vh; |
|
// display: flex; |
|
// align-items: center; |
|
// justify-content: center; |
|
// } |
|
|
|
.switch { |
|
position: relative; |
|
input[type="checkbox"] { |
|
visibility: hidden; |
|
position : absolute; |
|
&:checked + label { |
|
transform: rotate(0deg); |
|
background-color: #000; |
|
&:before { |
|
transform: translateX(35.5px); |
|
background-color: #fff; |
|
} |
|
} |
|
} |
|
|
|
label { |
|
display: flex; |
|
width: 70px; |
|
height: 34px; |
|
border: 3px solid; |
|
border-radius: 99em; |
|
position: relative; |
|
transition: transform 0.3s ease-in-out; |
|
transform-origin: 50% 50%; |
|
cursor: pointer; |
|
|
|
&:before { |
|
transition: transform 0.3s ease; |
|
transition-delay: 0s; |
|
content: ""; |
|
display: block; |
|
position: absolute; |
|
width: 24px; |
|
height: 24px; |
|
background-color: #000; |
|
border-radius: 50%; |
|
top: 2px; |
|
left: 3px; |
|
} |
|
} |
|
}
|
|
|