forked from quoid/userscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggle.css
More file actions
67 lines (58 loc) · 1.15 KB
/
Copy pathtoggle.css
File metadata and controls
67 lines (58 loc) · 1.15 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
.toggle {
--switch-timing: 150ms 75ms;
cursor: pointer;
display: block;
height: 16px;
min-width: 28px;
position: relative;
user-select: none;
width: 28px;
}
.toggle input[type=checkbox] {
display: block;
position: absolute;
visibility: hidden;
}
.toggle span {
background-color: #777;
border-radius: 10px;
display: block;
height: 100%;
transition: background-color var(--switch-timing);
width: 100%;
}
.toggle span::before {
background-color: white;
border-radius: 50%;
content: "";
height: 12px;
left: 2px;
position: absolute;
top: 2px;
transition: all var(--switch-timing);
width: 12px;
}
.toggle input:checked + span {
background-color: var(--link-color);
}
.toggle input:checked + span::before {
left: calc(26px - 12px);
}
.toggle svg {
display: none;
height: 16px;
position: absolute;
right: 0;
top: 0;
width: 16px;
}
.toggle input:disabled + span + svg {
display: block;
}
.toggle input:disabled + span {
opacity: 0;
}
/* disable pointer events for the sake of event listeners */
.toggle span {
pointer-events: none;
}