Skip to content

Commit 5b9bf5e

Browse files
committed
Fix optgroup normalization and add test
Ref gh-102
1 parent 3d3096d commit 5b9bf5e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

normalize.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,15 @@ textarea {
296296
margin: 0; /* 3 */
297297
}
298298

299+
/**
300+
* Re-apply the `font-weight` to avoid modifying the default UX, and because
301+
* the default cannot be changed in Chrome and Safari on OS X.
302+
*/
303+
304+
optgroup {
305+
font-weight: bold;
306+
}
307+
299308
/**
300309
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
301310
* the UA stylesheet.

test.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,13 @@ <h1>Forms</h1>
300300
<p><label><input type="checkbox"> Checkbox input</label></p>
301301

302302
<p><label>Select field <select><option>Option 01</option><option>Option 02</option></select></label></p>
303+
<p><label>Select with optgroup
304+
<select>
305+
<optgroup label="Optgroup label">
306+
<option>Option 01</option>
307+
<option>Option 02</option>
308+
</select>
309+
</label></p>
303310
<p><label>Textarea <textarea cols="30" rows="5" >Textarea text</textarea></label></p>
304311
</fieldset>
305312

0 commit comments

Comments
 (0)