-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch.css
More file actions
40 lines (36 loc) · 837 Bytes
/
switch.css
File metadata and controls
40 lines (36 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.switch-checkbox {
height: 0;
width: 0;
visibility: hidden;
}
.switch-label {
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
width: 40px;
height: 20px;
background: grey;
border-radius: 100px;
position: relative;
transition: background-color .2s;
}
.switch-label .switch-button {
content: '';
position: absolute;
top: 2px;
left: 2px;
width: 15px;
height: 15px;
border-radius: 50%;
transition: 0.3s;
background: #fff;
box-shadow: 0 0 2px 0 rgba(10, 10, 10, 0.29);
}
.switch-checkbox:checked + .switch-label .switch-button {
left: calc(60% - 1px);
transform: translateX(0%);
}
.switch-label:active .switch-button {
width: 30px;
}