-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathios-toggle.scss
More file actions
78 lines (63 loc) · 2.22 KB
/
Copy pathios-toggle.scss
File metadata and controls
78 lines (63 loc) · 2.22 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
@import "compass";
@mixin ios-toggle($height:35px, $active:#53d76a, $inactive:#fff, $border:#d3d3d3) {
$width: ($height * 2) - ($height / 3.25);
$offset: $width - $height - 2;
.ios-toggle {
display: inline-block;
vertical-align: middle;
&> div {
// Reset the element
margin: 0;
padding: 0;
border: none;
// Set the dimensions
display: inline-block;
height: $height;
width: $width;
position: relative;
// Surrounding text should look inline
cursor: pointer;
vertical-align: middle;
background-color: darken($inactive, 2%);
border: 1px solid $border;
@include border-radius($height);
@include box-shadow(inset 0 0 0 1px $border);
@include transition(border .25s .15s,
box-shadow .25s .3s,
padding .25s);
&:after {
content: '';
display: block;
height: $height - 2;
position: absolute;
left: 0;
right: $offset;
top: 0;
background-color: $inactive;
border: 1px solid $border;
@include border-radius($height - 2);
@include box-shadow(inset 0 -3px 3px hsla(0,0%,0%,.025),
0 1px 4px hsla(0,0%,0%,.15),
0 4px 4px hsla(0,0%,0%,.1));
@include transition(border .25s .15s,
left .25s .1s,
right .15s .175s);
}
&.coActive {
border-color: $active;
@include box-shadow(inset 0 0 0 ($height / 2 + 1) $active);
@include transition(border .25s,
box-shadow .25s,
padding .25s .15s);
&:after {
border-color: $active;
left: $offset;
right: 0;
@include transition(border .25s,
left .15s .25s,
right .25s .175s);
}
}
}
}
}