-
Notifications
You must be signed in to change notification settings - Fork 0
/
switch.css
36 lines (34 loc) · 853 Bytes
/
switch.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
input[type="checkbox"][role="switch"] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
position: relative;
font-size: inherit;
width: 2.1em;
height: 1em;
box-sizing: content-box;
border: 1px solid;
/* border-radius: 1em; */
vertical-align: text-bottom;
margin: auto;
color: var(--theme, inherit);
}
input[type="checkbox"][role="switch"]::before {
content: "";
position: absolute;
top: 50%;
left: 0;
transform: translate(0, -50%);
box-sizing: border-box;
width: 0.86em;
height: 0.85em;
margin: 0 0.15em;
border: 1px solid;
/* border-radius: 50%; */
background: var(--dark, #000);
}
input[type="checkbox"][role="switch"]:checked::before {
left: 1em;
background: var(--theme, #000);
border: 1px solid var(--theme, #000);
}