Skip to content

Commit 5d728b8

Browse files
author
Jonathan Neal
authored
More explicitly define font resets on form controls (#607)
1 parent db6567c commit 5d728b8

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* Move unsorted rules into their respective sections.
88
* Update the `summary` style in all browsers.
99
* Remove `::placeholder` styles due to a bug in Edge.
10+
* More explicitly define font resets on form controls
11+
* Remove the `optgroup` normalization needed by the previous font reset
1012

1113
### 4.2.0 (June 30, 2016)
1214

normalize.css

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ svg:not(:root) {
244244
========================================================================== */
245245

246246
/**
247-
* 1. Change font properties to `inherit` in all browsers (opinionated).
247+
* 1. Change the font styles in all browsers (opinionated).
248248
* 2. Remove the margin in Firefox and Safari.
249249
*/
250250

@@ -253,18 +253,12 @@ input,
253253
optgroup,
254254
select,
255255
textarea {
256-
font: inherit; /* 1 */
256+
font-family: sans-serif; /* 1 */
257+
font-size: 100%; /* 1 */
258+
line-height: 1.15; /* 1 */
257259
margin: 0; /* 2 */
258260
}
259261

260-
/**
261-
* Restore the font weight unset by the previous rule.
262-
*/
263-
264-
optgroup {
265-
font-weight: bold;
266-
}
267-
268262
/**
269263
* Show the overflow in IE.
270264
* 1. Show the overflow in Edge.

test.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ <h3 class="Test-it">should have a <code>content-box</code> box model</h3>
259259
</div>
260260

261261
<h2 class="Test-describe"><code>button</code>, <code>input</code>, <code>optgroup</code>, <code>select</code>, <code>textarea</code></h2>
262-
<h3 class="Test-it">should inherit <code>font</code> from ancestor</h3>
263-
<div class="Test-run" style="font:bold italic 20px/1 serif;">
262+
<h3 class="Test-it">should inherit <code>font-size</code> from ancestor</h3>
263+
<div class="Test-run" style="font-size: 20px;">
264264
<button>button</button><br>
265265
<input value="input"><br>
266266
<select style="border:1px solid #999;">

0 commit comments

Comments
 (0)