-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathangular-named-toggle.scss
More file actions
123 lines (98 loc) · 2.97 KB
/
Copy pathangular-named-toggle.scss
File metadata and controls
123 lines (98 loc) · 2.97 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
122
123
@import "compass";
@mixin named-toggle(
$active: #53d76a,
$inactive: #eee,
$knob: #fff,
$border: #d3d3d3,
$activeText: #FFF,
$inactiveText: #000
) {
.co-toggle {
display: inline-block;
vertical-align: middle;
&> div {
display: inline-block;
overflow: hidden;
position: relative;
min-width: 100px;
cursor: pointer;
border: 1px solid $border;
border-radius: 4px;
text-align: left;
line-height: 8px;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
// This is what forces the switch width
&> span.switch-min {
height: 0;
margin: 0;
padding: 0;
border: 0;
}
&.disabled {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default !important;
.switch-left,
.switch-right,
.knob {
cursor: default !important;
}
}
&> div {
position: relative;
width: 150%;
// off by default
left: -50%;
&.coActive {
left: 0%;
}
&.switch-animate {
transition: left 0.2s;
-o-transition: left 0.2s;
-moz-transition: left 0.2s;
-webkit-transition: left 0.2s;
}
}
span {
display: inline-block;
width: 33%;
height: 100%;
float: left;
@include box-sizing(border-box);
cursor: pointer;
padding: 0.1em;
line-height: 1.7em;
text-align: center;
white-space: nowrap;
&.knob {
margin-top: -1px;
margin-bottom: -1px;
border-left: 1px solid $border;
border-right: 1px solid $border;
border-bottom: 2px solid $border;
background: $knob;
width: 34%;
z-index: 100;
text-align: center;
}
&.switch-left,
&.switch-right {
z-index: 1;
}
&.switch-left {
color: $activeText;
background: $active; //#428bca;
}
&.switch-right {
color: $inactiveText;
background: $inactive;
}
}
}
}
}