Skip to content

Commit

Permalink
Improve consistency of default fonts (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus authored Feb 11, 2018
1 parent d2fb52d commit 4e119e0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
35 changes: 22 additions & 13 deletions modern-normalize.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ body {
margin: 0;
}

/**
* Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
*/

body {
font-family:
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Helvetica,
Arial,
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol';
}

/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
Expand All @@ -57,16 +75,6 @@ hr {
height: 0;
}

/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/

pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}

/* Text-level semantics
========================================================================== */

Expand All @@ -88,14 +96,15 @@ strong {
}

/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
* 2. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
samp,
pre {
font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; /* 1 */
font-size: 1em; /* 2 */
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"stylelint": {
"extends": "stylelint-config-xo",
"rules": {
"font-family-no-duplicate-names": null,
"no-duplicate-selectors": null
}
}
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Smaller
- Includes only normalizations for the latest Chrome, Firefox, and Safari
- [Sets `box-sizing: border-box`](https://www.paulirish.com/2012/box-sizing-border-box-ftw/)
- [Improves consistency of default fonts](https://github.com/sindresorhus/modern-normalize/issues/3)

All credit should go to `normalize.css`. I just removed some cruft and added some improvements. If you have questions about the source, check out the [original source](https://github.com/necolas/normalize.css/blame/master/normalize.css) and [this](https://github.com/necolas/normalize.css#extended-details-and-known-issues) for details.

Expand Down

0 comments on commit 4e119e0

Please sign in to comment.