This repository has been archived by the owner on Jul 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.css
98 lines (85 loc) · 1.94 KB
/
style.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
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
/* Use borderbox */
.switch-button, .switch-button * {
box-sizing: border-box;
}
/* Just a container */
.switch-button { }
/* Hide the magic */
.switch-button > input {
display: none;
}
/* Unchecked state */
.switch-button > label {
cursor: pointer;
display: inline-block;
position: relative;
width: 80px;
height: 34px;
padding: 2px;
border: none;
border-radius: 26px;
font-size: 15px;
background: #f4f5f5;
box-shadow: inset 0 1px 3px rgba(0,0,0,.25);
transition: background-color .18s ease-out;
will-change: background-color;
font-family: 'Roboto', sans-serif;
/* Do not select anything */
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* Unchecked state - knob */
.switch-button > label::after {
content: '';
position: absolute;
top: 2px;
left: 2px;
bottom: 2px;
width: 30px;
height: 30px;
border-radius: 50%;
background-color: #fff;
box-shadow: 0 1px 3px rgba(0,0,0,.25);
transition: left .18s ease-out;
will-change: left;
}
/* Unchecked state - response text */
.switch-button > label::before {
content: attr(data-false);
position: absolute;
top: 2px;
bottom: 2px;
left: 2px;
right: 2px;
text-align: right;
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
padding: 0;
padding-right: 15px;
line-height: 35px;
text-align: right;
-webkit-font-smoothing: antialiased;
color: #717784;
will-change: text-align;
}
/* Checked state */
.switch-button > input:checked + label {
background-color: #74ba02;
}
/* Checked state - knob */
.switch-button > input:checked + label::after {
left: calc(100% - 32px);
}
/* Checked state - response text */
.switch-button > input:checked + label::before {
content: attr(data-true);
padding-right: 0;
padding-left: 11px;
text-align: left;
color: #fff;
}