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 h5bp#1474
Close h5bp#1691
  • Loading branch information
drublic authored and alrra committed Apr 10, 2015
1 parent bd66eb9 commit 3b437e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions 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

0 comments on commit 3b437e0

Please sign in to comment.