-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathtoggle.css
More file actions
72 lines (70 loc) · 1.24 KB
/
toggle.css
File metadata and controls
72 lines (70 loc) · 1.24 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
66
67
68
69
70
71
72
label {
width: 80px;
height: 40px;
position: relative;
display: block;
background: #ebebeb;
border-radius: 200px;
box-shadow: inset 0px 5px 15px rgba(0, 0, 0, 0.4),
inset 0px -5px 15px rgba(255, 255, 255, 0.4);
cursor: pointer;
transition: 0.3s;
&:after {
content: "";
width: 30px;
height: 30px;
position: absolute;
top: 5px;
left: 10px;
background: linear-gradient(180deg, #ffcc89, #d8860b);
border-radius: 180px;
box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
transition: 0.3s;
}
svg {
position: absolute;
width: 20px;
top: 10px;
z-index: 100;
&.sun {
left: 15px;
fill: #fff;
transition: 0.3s;
}
&.moon {
left: 50px;
fill: #7e7e7e;
transition: 0.3s;
}
}
}
input {
width: 0;
height: 0;
visibility: hidden;
&:checked + label {
background: #242424;
&:after {
left: 74px;
transform: translateX(-100%);
background: linear-gradient(180deg, #777, #3a3a3a);
}
svg {
&.sun {
fill: #7e7e7e;
}
&.moon {
fill: #fff;
}
}
+ .background {
background: #242424;
}
}
&:active:after {
width: 80px;
}
}
.background {
transition: 0.3s;
}