-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslider.css
More file actions
65 lines (55 loc) · 1.19 KB
/
slider.css
File metadata and controls
65 lines (55 loc) · 1.19 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.switch {
position: relative;
display: inline-block;
width: 90px;
height: 15px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
-webkit-transition: 1.5s;
transition: 1.5s;
background-color: var(--slider-color);
}
input:checked + .slider {
background-color: var(--slider-color);
}
.slider:before {
position: absolute;
content: "";
height: 30px;
width: 30px;
left: -1px;
bottom: 4px;
top: 0;
bottom: 0;
margin: auto 0;
-webkit-transition: 1.5s;
transition: 1.5s;
background: var(--page-background-color) url(moon.svg);
background-repeat: no-repeat;
background-position: center;
}
input:checked + .slider:before {
-webkit-transform: translateX(65px);
-ms-transform: translateX(65px);
transform: translateX(65px);
background: var(--page-background-color) url(sun.svg);
background-repeat: no-repeat;
background-position: center;
}
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}