@@ -93,8 +93,8 @@ $margin-label: em(map-get($inputs-label, margin));
93
93
94
94
/* Radio Buttons */
95
95
96
- $default-border : map-deep-get ($inputs-radiobutton , default-color , base );
97
- $checked-border : map-deep-get ($inputs-radiobutton , checked-color , base );
96
+ $radio- default-border : map-deep-get ($inputs-radiobutton , default-color , base );
97
+ $radio- checked-border : map-deep-get ($inputs-radiobutton , checked-color , base );
98
98
99
99
@mixin radiobutton () {
100
100
opacity : 0 ;
@@ -114,7 +114,7 @@ $checked-border: map-deep-get($inputs-radiobutton, checked-color, base);
114
114
vertical-align : middle ;
115
115
width : map-get ($inputs-radiobutton , width );
116
116
height : map-get ($inputs-radiobutton , height );
117
- box-shadow : 0 2px 2px 0 rgba (0 ,0 ,0 ,.24 ), inset 0 0 0 1px $default-border ;
117
+ box-shadow : 0 2px 2px 0 rgba (0 ,0 ,0 ,.24 ), inset 0 0 0 1px $radio- default-border ;
118
118
padding : 2px ;
119
119
margin-right : 10px ;
120
120
text-align : center ;
@@ -123,7 +123,67 @@ $checked-border: map-deep-get($inputs-radiobutton, checked-color, base);
123
123
}
124
124
125
125
& :checked + & -label :before {
126
- box-shadow : 0 2px 2px 0 rgba (0 ,0 ,0 ,.24 ), inset 0 0 0 7px $checked-border ;
126
+ box-shadow : 0 2px 2px 0 rgba (0 ,0 ,0 ,.24 ), inset 0 0 0 7px $radio- checked-border ;
127
127
transition : box-shadow .2s ;
128
128
}
129
129
}
130
+
131
+ /* Checkboxes */
132
+
133
+ $checkbox-default-border : map-deep-get ($inputs-checkbox , default-color , base );
134
+ $checkbox-checked-border : map-deep-get ($inputs-checkbox , checked-color , base );
135
+
136
+ @mixin checkbox () {
137
+ opacity : 0 ;
138
+ position : absolute ;
139
+
140
+ & -label {
141
+ display : inline-block ;
142
+ vertical-align : middle ;
143
+ margin : 5px ;
144
+ cursor : pointer ;
145
+ position : relative ;
146
+ }
147
+
148
+ & + & -label :before {
149
+ content : " " ;
150
+ display : inline-block ;
151
+ vertical-align : middle ;
152
+ width : map-get ($inputs-checkbox , width );
153
+ height : map-get ($inputs-checkbox , height );
154
+ box-shadow : 0 2px 2px 0 rgba (0 ,0 ,0 ,.24 );
155
+ padding : 2px ;
156
+ border : 1px solid $checkbox-default-border ;
157
+ margin-right : 10px ;
158
+ text-align : center ;
159
+ border-radius : 3px ;
160
+ transition : background-color .1s ;
161
+ }
162
+
163
+ & + & -label :after {
164
+ content : " " ;
165
+ width : 12px ;
166
+ height : 6px ;
167
+ position : absolute ;
168
+ top : 9px ;
169
+ left : 6px ;
170
+ border : 3px solid #fff ;
171
+ border-top : none ;
172
+ border-right : none ;
173
+ background : transparent ;
174
+ opacity : 0 ;
175
+ transform : rotate (-65deg );
176
+ }
177
+
178
+ & :checked + & -label :before {
179
+ background : $checkbox-checked-border ;
180
+ border-color : $checkbox-checked-border ;
181
+ transition : background-color .1s ;
182
+ }
183
+
184
+ & :checked + & -label :after {
185
+ opacity : 1 ;
186
+ transform : rotate (-45deg );
187
+ transition : transform .1s ;
188
+ }
189
+ }
0 commit comments