Skip to content

Commit

Permalink
Update the high resolution media query
Browse files Browse the repository at this point in the history
Add `dppx` variant of `min-resolution` to the high resolution media
query as `dppx` is more accurate¹ than `dpi`.

Notes:

 * since `dppx` is not supported by all browsers the media query
   still needs the `dpi` fallback

 * this change removes the `dppx` related warning² from Blink based
   browsers (e.g.: Chrome, Opera)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ `dpi` (dots per inch) refers to a defined size of pixels where one
  inch is `96px` no matter what, so it does not take into consideration
  the physical inches.

² "Consider using 'dppx' units, as in CSS 'dpi' means dots-per-CSS-inch,
   not dots-per-physical-inch, so does not correspond to the actual 'dpi'
   of a screen. In media query expression: print,
   (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi)"

Fix #1474
Close #1691
  • Loading branch information
drublic authored and alrra committed Apr 10, 2015
1 parent 6ee34e1 commit 0d9f008
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### HEAD

* Update high resolution media query
([#1474](https://github.com/h5bp/html5-boilerplate/issues/1474)).
* Update Apache Server Configs to `v2.14.0`.

### 5.1.0 (April 1, 2015)
Expand Down
1 change: 1 addition & 0 deletions dist/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ textarea {

@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
/* Style adjustments for high resolution devices */
}
Expand Down
1 change: 1 addition & 0 deletions src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ textarea {
}

@media print,
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
/* Style adjustments for high resolution devices */
}
Expand Down

0 comments on commit 0d9f008

Please sign in to comment.