Le 16 juil. 2012 à 06:42, Micky Hulse a écrit :

> <http://jsbin.com/odipeq>
> 
> Hope that helps.
> 
> All three media queries (view source on demo page) work for retina
> display iPhone…

And those will work on a Retina MBP, fwiw.

> 
> I assume the "min" part of "min-device-pixel-ratio" means that 2.0
> pixel ratio devices will work if the value is 1.5 (at a very minimum,
> it appears that the iPhone does). I'm just looking for confirmation
> here (I could not find concrete docs that said verified my thinking).

Correct, the 'min' stands for minimum, thus anything that is equal to 1.5 or 
higher. Whether it is a good idea to blindly go for all devices that return a 
value of 1.5 + is 'nother discussion, in the light of persistent internet 
rumours about a device with a device-pixel-ratio of 4 appearing in the next 
20years or so…

> I've seen examples where folks use:
> 
> -moz-min-device-pixel-ratio
> 
> But when reading the MDN:
> 
> <https://developer.mozilla.org/en/CSS/Media_queries/#-moz-device-pixel-ratio>
> 
> ... it looks like they suggest:
> 
> min--moz-device-pixel-ratio

MDN is correct (luckily). Too many people just blindly copy-paste without even 
bothering thinking.

BTW, the current 'official' way to write those resolution media-queries would 
be 
@media screen and (min-resolution: 2dppx) { /*stuff here */ }

http://dev.w3.org/csswg/css3-values/#resolution

But no browser support this, yet.

min-device-pixel-ratio is not officially documented anywhere (Apple invented 
this for Retina devices), it might become official in a future css4 media 
queries module though. I personally find it immensely more readable than the 
'dppx' one (I had to look up the exact spelling of 'dppx' again while writing 
this).


Philippe
--
Philippe Wittenbergh
http://l-c-n.com/






______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to