forked from CoreBunch/Instatic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwitch.module.css
More file actions
100 lines (83 loc) · 1.64 KB
/
Copy pathSwitch.module.css
File metadata and controls
100 lines (83 loc) · 1.64 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/* Extracted from ToggleControl and Settings PreferencesSection switch styles. */
.switch {
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
padding: 0;
background: transparent;
border: 0;
cursor: pointer;
}
.switch[data-hit-area="true"] {
min-width: 44px;
min-height: 44px;
}
.switch:disabled {
cursor: not-allowed;
}
.track {
position: relative;
display: block;
width: 38px;
height: 22px;
border: 1px solid var(--overlay-20);
border-radius: 999px;
flex-shrink: 0;
transition: background-color 150ms ease;
}
.trackOn {
background: var(--bg-surface-3);
border-color: var(--bg-surface-3);
}
.trackOff {
background: transparent;
}
.switch[data-hit-area="true"] .track {
width: 32px;
height: 16px;
padding: var(--space-4xs);
box-sizing: content-box;
border: 0;
border-radius: 10px;
}
.switch[data-hit-area="true"] .trackOn {
background: var(--overlay);
}
.switch[data-hit-area="true"] .trackOff {
background: var(--border-muted);
}
.thumb {
position: absolute;
top: 2px;
width: 16px;
height: 16px;
border-radius: 50%;
transition: left 150ms ease;
}
.thumbOn {
left: 18px;
background: var(--text);
}
.thumbOff {
left: 3px;
background: var(--text);
}
.switch[data-size="sm"] .track {
width: 28px;
height: 16px;
}
.switch[data-size="sm"] .thumb {
top: 2px;
width: 10px;
height: 10px;
}
.switch[data-size="sm"] .thumbOn {
left: 15px;
}
.switch[data-size="sm"] .thumbOff {
left: 3px;
}
.switch[data-hit-area="true"] .thumbOff {
left: 2px;
}