Introduce a new, cross-browser HiDPI CSS @media rule to be used everywhere.

{{{
@media print,
  (-o-min-device-pixel-ratio: 5/4),
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 120dpi) {
}}}

Serve HiDPI graphics for printing, regardless of screen resolution.

Specify Opera's vendor-prefixed device pixel ratio property, for Opera desktop.

Specify a minimum Webkit device pixel ratio of 1.25 instead of 1.5, to serve
2x images to Android devices that are between 1 and 1.5x (like the Nexus 7).
Firefox and Opera will respond to 1.5x on these devices, but Chrome will not.

Specify min-resolution, which covers Firefox 19. Opera on Android also supports
min-resolution, but Opera Mini does not support dppx, so the dpi unit is used.

props iammattthomas for the exhaustive research.
props lessbloat for patching.

fixes #22238.



git-svn-id: http://core.svn.wordpress.org/trunk@22629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin
2012-11-17 06:50:08 +00:00
parent 0a888e8aa0
commit 7183a9cce9
11 changed files with 128 additions and 119 deletions

View File

@@ -406,13 +406,6 @@
display: inline-block;
}
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
#wpadminbar .quicklinks li div.blavatar {
background: url('../images/wpmini-blue-2x.png') no-repeat;
background-size: 16px 16px;
}
}
/**
* Search
*/
@@ -600,7 +593,10 @@
/**
* Retina display 2x icons
*/
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
#wpadminbar .menupop .menupop > .ab-item,
#wpadminbar .ab-top-secondary .menupop .menupop > .ab-item,
#wpadminbar #adminbarsearch .adminbar-input,
@@ -611,6 +607,11 @@
background-image: url(../images/admin-bar-sprite-2x.png?d=20120830);
background-size: 20px 220px;
}
#wpadminbar .quicklinks li div.blavatar {
background: url('../images/wpmini-blue-2x.png') no-repeat;
background-size: 16px 16px;
}
}
/* Skip link */

View File

@@ -2027,7 +2027,10 @@ RTL
/* HiDPI */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.wp_themeSkin span.mce_undo,
.wp_themeSkin span.mce_redo,
.wp_themeSkin span.mce_bullist,

View File

@@ -189,7 +189,10 @@
/**
* HiDPI Displays
*/
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.wp-pointer-buttons a.close:before {
background-image: url('../images/xit-2x.gif');