4 ms·
Can you use CSS media queries to detect the display's DPI? I haven't seen any examples of that. You can at least detect the 'device pixel ratio', which seems t
by kevingadd 14y ago
Can you use CSS media queries to detect the display's DPI? I haven't seen any examples of that.
You can at least detect the 'device pixel ratio', which seems to be > 1.0 for Retina devices, so that's something:
http://stackoverflow.com/questions/11722442/is-there-a-way-to-use-dpi-in-css-media-queries-instead-of-px http://stackoverflow.com/questions/11722442/is-there-a-way-t...
- cstejerean 14y agoDevice pixel ratio in CSS is how I've seen every website implement retina support. Definitely possible, and not at all uncommon.
- lancer383 14y agoNot sure how well adopted it is, but Bourbon CSS's mixin for serving Hi-DPI assets includes DPI-based media queries: @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 1.5/1), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) { width: 260px; }