Skip to content

Commit 1d693f8

Browse files
committed
Add checkbox/radio styling
1 parent 9a692ab commit 1d693f8

File tree

2 files changed

+119
-2
lines changed

2 files changed

+119
-2
lines changed

src/doc/partials/forms.hbs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@
2424
<input type="checkbox"> Check me out
2525
</label>
2626
</div>
27+
<div class="radio">
28+
<label>
29+
<input type="radio" name='radio1'> Radio me out
30+
</label>
31+
</div>
32+
<div class="radio">
33+
<label>
34+
<input type="radio" name='radio1'> Radio me out
35+
</label>
36+
</div>
2737
<button type="submit" class="btn btn-default">Submit</button>
2838
</form>
2939
{{#markdown}}
@@ -47,6 +57,16 @@
4757
<input type="checkbox"> Check me out
4858
</label>
4959
</div>
60+
<div class="radio">
61+
<label>
62+
<input type="radio" name='radio1'> Radio me out
63+
</label>
64+
</div>
65+
<div class="radio">
66+
<label>
67+
<input type="radio" name='radio1'> Radio me out
68+
</label>
69+
</div>
5070
<button type="submit" class="btn btn-default">Submit</button>
5171
</form>
5272
```
@@ -162,7 +182,7 @@
162182
<option>West Virginia</option>
163183
<option>Wisconsin</option>
164184
<option>Wyoming</option>
165-
</select>
185+
</select>
166186

167187
{{#markdown}}
168188
```xml
@@ -257,7 +277,7 @@
257277
<option>West Virginia</option>
258278
<option>Wisconsin</option>
259279
<option>Wyoming</option>
260-
</select>
280+
</select>
261281
```
262282
{{/markdown}}
263283
</div>

src/scss/override/_forms.scss

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,101 @@ select[multiple].form-control {
168168
color: #fff;
169169
background-color: $win-color-accent;
170170
}
171+
}
172+
173+
//
174+
// Checkbox / Radio
175+
//
176+
.checkbox label,
177+
.radio label {
178+
padding-left: 30px;
179+
}
180+
181+
.checkbox input[type=checkbox],
182+
.radio input[type=radio] {
183+
width: 20px;
184+
height: 20px;
185+
margin-left: -30px;
186+
187+
&::-ms-check {
188+
border-style: solid;
189+
display: inline-block;
190+
border-width: 2px;
191+
background-clip: border-box;
192+
}
193+
}
194+
195+
.checkbox input[type=checkbox] {
196+
&::-ms-check {
197+
color: $win-color-base;
198+
border-color: $win-color-base-high;
199+
background-color: transparent;
200+
}
201+
202+
&:indeterminate::-ms-check {
203+
color: $win-color-base-high;
204+
border-color: $win-color-accent;
205+
}
206+
207+
&:checked::-ms-check {
208+
color: #fff;
209+
background-color: $win-color-accent;
210+
border-color: transparent;
211+
}
212+
213+
&:hover::-ms-check {
214+
border-color: $win-color-base;
215+
}
216+
217+
&:hover:indeterminate::-ms-check {
218+
color: $win-color-base;
219+
border-color: $win-color-accent;
220+
}
221+
222+
&:active::-ms-check {
223+
border-color: transparent;
224+
background-color: $win-color-base-medium-high;
225+
}
226+
227+
&:indeterminate:active::-ms-check {
228+
color: $win-color-base-medium-high;
229+
border-color: $win-color-base-high;
230+
background-color: transparent;
231+
}
232+
233+
&:disabled::-ms-check, &:indeterminate:disabled::-ms-check {
234+
color: $win-color-base-medium-low;
235+
border-color: $win-color-base-medium-low;
236+
background-color: transparent;
237+
}
238+
}
239+
240+
.radio input[type=radio] {
241+
&::-ms-check {
242+
color: $win-color-base-high;
243+
border-color: $win-color-base-high;
244+
background-color: transparent;
245+
}
246+
247+
&:hover::-ms-check {
248+
border-color: $win-color-base;
249+
}
250+
251+
&:checked::-ms-check {
252+
border-color: $win-color-accent;
253+
}
254+
255+
&:hover::-ms-check {
256+
color: $win-color-base;
257+
}
258+
259+
&:active::-ms-check {
260+
color: $win-color-base-medium-high;
261+
border-color: $win-color-base-medium-high;
262+
}
263+
264+
&:disabled::-ms-check {
265+
color: $win-color-base-medium-low;
266+
border-color: $win-color-base-medium-low;
267+
}
171268
}

0 commit comments

Comments
 (0)