Skip to content

Commit

Permalink
Improve font rendering on HiDPI devices
Browse files Browse the repository at this point in the history
Fixes #19
  • Loading branch information
sindresorhus committed Feb 11, 2018
1 parent 36e9e45 commit a373054
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
20 changes: 16 additions & 4 deletions modern-base.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
/*! modern-base | MIT License | https://github.com/sindresorhus/modern-normalize */


/**
* Improve font rendering on HiDPI devices.
*/

@media
screen and (-webkit-min-device-pixel-ratio: 2),
screen and (min-resolution: 2dppx) {
body {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
}

/**
* 1. Break up words and URLs so they don't break your layout.
* 2. Improve font rendering in Chrome and Safari on macOS.
* Break up words and URLs so they don't break your layout.
*/

html {
word-break: break-all; /* 1 */
-webkit-font-smoothing: antialiased; /* 2 */
word-break: break-all;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"rules": {
"font-family-no-duplicate-names": null,
"no-duplicate-selectors": null,
"selector-no-vendor-prefix": null
"selector-no-vendor-prefix": null,
"media-feature-name-no-vendor-prefix": null
}
}
}

0 comments on commit a373054

Please sign in to comment.