Skip to content

Instantly share code, notes, and snippets.

@kof
Created October 7, 2013 10:27
Show Gist options
  • Save kof/6865717 to your computer and use it in GitHub Desktop.
Save kof/6865717 to your computer and use it in GitHub Desktop.
/******************************************************************************
* Screens DPI
* @see
* http://developer.android.com/guide/webapps/overview.html
* http://developer.android.com/guide/practices/screens_support.html
*****************************************************************************/
/*mdpi*/
@media (-webkit-min-device-pixel-ratio : 1) and (min-width: 320px), (min-device-pixel-ratio : 1) and (min-width: 320px) {
body {zoom: 0.5 !important;}
}
@media (-webkit-min-device-pixel-ratio : 1) and (min-width: 480px), (min-device-pixel-ratio : 1) and (min-width: 480px) {
body {zoom: 0.75 !important;}
}
@media (-webkit-min-device-pixel-ratio : 1) and (min-width: 720px), (min-device-pixel-ratio : 1) and (min-width: 720px) {
body {zoom: 1.12 !important;}
}
/*hdpi*/
@media (-webkit-min-device-pixel-ratio : 1.5) and (min-width: 480px), (min-device-pixel-ratio : 1.5) and (min-width: 480px) {
body {zoom: 0.88 !important;}
}
@media (-webkit-min-device-pixel-ratio : 1.5) and (min-width: 600px), (min-device-pixel-ratio : 1.5) and (min-width: 600px) {
body {zoom: 0.71 !important;}
}
@media (-webkit-min-device-pixel-ratio : 1.5) and (min-width: 640px), (min-device-pixel-ratio : 1.5) and (min-width: 640px) {
body {zoom: 0.66 !important;}
}
@media (-webkit-min-device-pixel-ratio : 1.5) and (min-width: 720px), (min-device-pixel-ratio : 1.5) and (min-width: 720px) {
body {zoom: 0.59 !important;}
}
/*xhdpi*/
@media (-webkit-min-device-pixel-ratio : 2) and (min-width: 640px), (min-device-pixel-ratio : 2) and (min-width: 640px) {
body {zoom: 0.5 !important;}
}
@media (-webkit-min-device-pixel-ratio : 2) and (min-width: 720px), (min-device-pixel-ratio : 2) and (min-width: 720px) {
body {zoom: 0.44 !important;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment