@@ -23,8 +23,9 @@ label.pack-switch input {
23
23
left : 0 ;
24
24
}
25
25
26
- label .pack-checkbox input + span ,
27
- label .pack-radio input + span {
26
+ label .pack-checkbox input ~ span : after ,
27
+ label .pack-radio input ~ span : after {
28
+ content : '' ;
28
29
position : absolute;
29
30
left : 50% ;
30
31
top : 50% ;
@@ -34,27 +35,27 @@ label.pack-radio input + span {
34
35
pointer-events : none;
35
36
}
36
37
37
- label .pack-checkbox input + span {
38
+ label .pack-checkbox input ~ span : after {
38
39
background : url (switches/images/check/default.png) no-repeat center top / 2.2rem auto;
39
40
}
40
41
41
- label .pack-radio input + span {
42
+ label .pack-radio input ~ span : after {
42
43
background : url (switches/images/radio/default.png) no-repeat center top / 2.2rem auto;
43
44
}
44
45
45
- label .pack-checkbox input : checked + span ,
46
- label .pack-radio input : checked + span ,
47
- label .pack-switch input : checked + span {
46
+ label .pack-checkbox input : checked ~ span : after ,
47
+ label .pack-radio input : checked ~ span : after ,
48
+ label .pack-switch input : checked ~ span : after {
48
49
background-position : center bottom;
49
50
}
50
51
51
52
/* 'Dangerous' switches */
52
53
53
- label .pack-checkbox .danger input + span {
54
+ label .pack-checkbox .danger input ~ span : after {
54
55
background-image : url (switches/images/check/danger.png);
55
56
}
56
57
57
- label .pack-radio .danger input + span {
58
+ label .pack-radio .danger input ~ span : after {
58
59
background-image : url (switches/images/radio/danger.png);
59
60
}
60
61
@@ -63,9 +64,10 @@ label.pack-radio.danger input + span {
63
64
* ON/OFF SWITCHES
64
65
* ---------------------------------- */
65
66
66
- label .pack-switch input + span {
67
+ label .pack-switch input ~ span : after {
68
+ content : '' ;
67
69
position : absolute;
68
- left : 50 % ;
70
+ right : 0 ;
69
71
top : 50% ;
70
72
margin : -1.1rem 0 0 -2.7rem ;
71
73
width : 5.1rem ;
@@ -79,16 +81,16 @@ label.pack-switch input + span {
79
81
}
80
82
81
83
/* switch: 'ON' state */
82
- label .pack-switch input : checked + span {
84
+ label .pack-switch input : checked ~ span : after {
83
85
background : # e6e6e6 url (switches/images/switch/background.png) no-repeat 0 0 / 8.3rem 2.1rem ;
84
86
border-color : # 00abcd ;
85
87
}
86
88
87
89
/* switch: disabled state */
88
- label .pack-switch input : disabled + span {
90
+ label .pack-switch input : disabled ~ span : after {
89
91
opacity : 0.4 ;
90
92
}
91
93
92
- label .pack-switch input .uninit + span {
94
+ label .pack-switch input .uninit ~ span : after {
93
95
transition : none;
94
96
}
0 commit comments