-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch.less
More file actions
executable file
·121 lines (101 loc) · 2.81 KB
/
Copy pathswitch.less
File metadata and controls
executable file
·121 lines (101 loc) · 2.81 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
.checkbox-switch, .checkbox.checkbox-switch, .form-group .checkbox.checkbox-switch {
padding-left: 0px;
position: relative;
cursor: pointer;
.user-select(none);
-webkit-tap-highlight-color: transparent;
tap-highlight-color: transparent;
&.switch-right {
.clearfix();
input + span {
float: right;
}
}
&.switch-xs {
input + span {
font-size: 12px;
}
}
&.switch-lg {
input + span {
font-size: 18px;
}
}
input {
opacity: 0;
position: absolute;
}
input + span {
font-size: 16px;
position: relative;
display: inline-block;
width: 1.65em;
height: 1em;
background: white;
box-shadow: inset 0 0 0 0.0625em @gb-form-control-border;
border-radius: 0.5em;
vertical-align: -0.15em;
transition: all 0.40s cubic-bezier(.17,.67,.43,.98);
}
&:active input + span, input + span:active {
box-shadow: inset 0 0 0 0.73em @gb-form-control-border;
}
input + span:after {
position: absolute;
display: block;
content: '';
width: 0.875em;
height: 0.875em;
border-radius: 0.4375em;
top: 0.0625em;
left: 0.0625em;
background: white;
box-shadow: inset 0 0 0 0.03em rgba(0,0,0,0.4),
0 0 0.05em rgba(0,0,0,0.35),
0 0.1em 0.2em rgba(0,0,0,0.4);
transition: all 0.25s ease-out;
}
&:active input + span:after,
input + span:active:after {
width: 1.15em;
}
input:checked + span {
box-shadow: inset 0 0 0 0.73em @gb-brand-success;
}
input:disabled + span {
opacity: 0.6;
}
input:checked + span:after {
left: 0.7125em;
}
&:active input:checked + span:after,
input:checked + span:active:after {
left: 0.4375em;
}
/* accessibility styles */
input:focus + span:after {
box-shadow: inset 0 0 0 0.03em rgba(0,0,0,0.15),
0 0 0.05em rgba(0,0,0,0.08),
0 0.1em 0.2em rgba(0,0,0,0.3);
background: #fff;
}
input:focus + span {
box-shadow: inset 0 0 0 0.0625em #dadada;
}
input:focus:checked + span {
box-shadow: inset 0 0 0 0.73em #33be4b;
}
/* reset accessibility style on hover */
&:hover input:focus + span:after {
box-shadow: inset 0 0 0 0.03em rgba(0,0,0,0.1),
0 0 0.05em rgba(0,0,0,0.05),
0 0.1em 0.2em rgba(0,0,0,0.2);
background: #fff;
}
&:hover input:focus + span {
box-shadow: inset 0 0 0 0.0625em #e9e9e9;
}
&:hover input:focus:checked + span {
box-shadow: inset 0 0 0 0.73em @gb-brand-success;
}
}