-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggle.css
More file actions
44 lines (43 loc) · 967 Bytes
/
toggle.css
File metadata and controls
44 lines (43 loc) · 967 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
41
42
43
44
.mi-toggle {
margin: 0;
}
.mi-toggle:disabled {
cursor: not-allowed;
}
.mi-toggle + .mi-label {
margin-left: 8px;
}
@supports (appearance: none) or (-moz-appearance: none) or (-webkit-appearance: none) {
.mi-toggle {
padding: 2px;
box-sizing: border-box;
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
width: 48px;
height: 24px;
border-radius: 9999px;
background-color: #6b7280;
transition: background-color 300ms ease;
}
.mi-toggle:disabled {
opacity: 0.48;
}
.mi-toggle:checked {
background-color: #16a34a;
}
.mi-toggle::after {
content: "";
display: inline-block;
width: 20px;
height: 20px;
transform: translateX(0px);
border-radius: 50%;
background-color: #fcfcfc;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2), 0px 1px 1px rgba(0, 0, 0, 0.2);
transition: 300ms ease;
}
.mi-toggle:checked::after {
transform: translateX(24px);
}
}