Last active
December 17, 2015 00:38
-
-
Save theaccordance/5522049 to your computer and use it in GitHub Desktop.
Method for providing higher quality images for Retina/4k enabled screens, using a Media Query to load the conditional values when screens match the specified criteria. Since retina graphics are twice the width and height of the original graphic, the rule set for retina graphics should also include an additional property (background-size) to tell…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Background Image Property for Normal Screens */ | |
| .ui-icon-menu { | |
| background: url('../img/icon-menu.png') center center no-repeat; | |
| } | |
| /* Background Image Property for Retina Screens */ | |
| @media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) { | |
| /* Best Practice: Indent Rulesets within Media Queries */ | |
| .ui-icon-menu { | |
| background: url('../img/icon-menu@2x.png') no-repeat; | |
| background-size: 24px 24px; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment