-
Notifications
You must be signed in to change notification settings - Fork 0
/
button.css
59 lines (58 loc) · 1.33 KB
/
button.css
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
/*--darkmode-->
as seen on: https://redstapler.co/pure-css-minimal-dark-mode-toggle-button/
checkbox targets the next label in order to work
*/
#clicky {
width:24px;
height:42px;
position: absolute;
display: block;
background: #ebebeb;
border-radius: 20px;
box-shadow: inset 0px 2px 5px rgba(0,0,0,0.4), inset 0px -2px 5px rgba(255,255,255,0.4);
cursor: pointer;
transition: 0.3s;
top:15px;
left:0.5%;
margin: auto;
z-index: 10;
}
#clicky:after {
content: "";
width:20px;
height: 20px;
position: absolute;
top:2px;
left:2px;
background: linear-gradient(180deg,#ffcc89,#d8860b);
border-radius: 20px;
box-shadow: 0px 2px 5px rgba(0,0,0,0.2);
transition: 0.3s;
}
#darkmode-toggle {
/*--the button should be "visibility:hidden" unless debugging--*/
position: absolute;
top: 5vh;
width: 20px;
height: 20px;
z-index: 100;
visibility: hidden;
}
#darkmode-toggle:checked + #clicky {
background: #242424;
}
#darkmode-toggle:checked + #clicky:after {
top: calc(3% + 40px);
transform: translateY(-100%);
background: linear-gradient(180deg,#777,#3a3a3a);
}
#clicky:active:after{
height: 38px;
}
@media print {
/*hide button on print
*/
#clicky{
visibility: hidden;
}
}