-
Notifications
You must be signed in to change notification settings - Fork 5
/
toggleswitch.css
105 lines (97 loc) · 3.04 KB
/
toggleswitch.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
99
100
101
102
103
104
105
.toggleswitch {
border: 0.1em solid #444;
display: inline-block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
width: 5em;
height: 2em;
overflow: hidden;
cursor: pointer;
-webkit-border-radius: 1.1em;
-moz-border-radius: 1.1em;
border-radius: 1.1em;
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.toggleswitch > input {
display: none;
}
.toggleswitch > input ~ .toggleswitch-inner {
margin-left: -3em;
-webkit-transition: margin-left 0.2s ease;
-moz-transition: margin-left 0.2s ease;
-o-transition: margin-left 0.2s ease;
transition: margin-left 0.2s ease;
}
.toggleswitch > input:checked ~ .toggleswitch-inner {
margin-left: 0;
}
.toggleswitch > .toggleswitch-inner {
display: block;
width: 8em;
height: 2em;
color: #fff;
overflow: hidden;
text-shadow: 0 -0.1em 0 rgba(0, 0, 0, 0.8);
filter: dropshadow(color=#000000, offx=0, offy=-1);
-webkit-border-radius: 1em;
-moz-border-radius: 1em;
border-radius: 1em;
}
.toggleswitch-inner > * {
display: block;
float: left;
height: 2em;
line-height: 2em;
-webkit-box-shadow: inset 0 0.2em 0.4em rgba(0, 0, 0, 0.75);
-moz-box-shadow: inset 0 0.2em 0.4em rgba(0, 0, 0, 0.75);
box-shadow: inset 0 0.2em 0.4em rgba(0, 0, 0, 0.75);
}
.toggleswitch-inner > .toggleswitch-on {
background: #0b0;
width: 3em;
padding-left: 1em;
-moz-border-radius-topleft: 0.8em;
-moz-border-radius-topright: 0;
-moz-border-radius-bottomright: 0;
-moz-border-radius-bottomleft: 0.8em;
-webkit-border-radius: 0.8em 0 0 0.8em;
border-radius: 0.8em 0 0 0.8em;
}
.toggleswitch-inner > .toggleswitch-off {
background: #b00;
width: 3em;
padding-right: 1em;
text-align: right;
-moz-border-radius-topleft: 0;
-moz-border-radius-topright: 0.8em;
-moz-border-radius-bottomright: 0.8em;
-moz-border-radius-bottomleft: 0;
-webkit-border-radius: 0 0.8em 0.8em 0;
border-radius: 0 0.8em 0.8em 0;
}
.toggleswitch-inner > .toggleswitch-handle {
background: #eee;
background: -moz-linear-gradient(top, #eee 0%, #aaa 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eee), color-stop(100%, #aaa)); /* Chrome, Safari4+ */
background: -webkit-linear-gradient(top, #eee 0%, #aaa 100%); /* Chrome10+, Safari5.1+ */
background: -o-linear-gradient(top, #eee 0%, #aaa 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #eee 0%, #aaa 100%); /* IE10+ */
background: linear-gradient(top, #eee 0%, #aaa 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#aaaaaa', GradientType=0); /* IE6-9 */
width: 2em;
margin-left: -5em;
-webkit-box-shadow: 0 0.15em 0.4em #000;
-moz-box-shadow: 0 0.15em 0.4em #000;
box-shadow: 0 0.15em 0.4em #000;
border: 0.1em solid #999;
-webkit-border-radius: 0.99em;
-moz-border-radius: 0.99em;
border-radius: 0.99em;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}