Skip to content

Instantly share code, notes, and snippets.

@skoch
Last active April 21, 2017 22:15
Show Gist options
  • Save skoch/be2078224c72f4fd3cd3d933c72302b8 to your computer and use it in GitHub Desktop.
Save skoch/be2078224c72f4fd3cd3d933c72302b8 to your computer and use it in GitHub Desktop.
Output from contentful-retina mixin
/* usage */
.something {
@include contentful_retina('space_id/asset_id/token/name.jpg', 1024, 3, cover, no-repeat center center);
}
/* output */
.something {
background: url("http://images.contentful.com/space_id/asset_id/token/name.jpg?w=1024") no-repeat center center;
background-size: cover; }
@media all and (-webkit-min-device-pixel-ratio: 1.5), all and (-o-min-device-pixel-ratio: 3 / 2), all and (min--moz-device-pixel-ratio: 1.5), all and (min-device-pixel-ratio: 1.5) {
.something {
background: url("http://images.contentful.com/space_id/asset_id/token/name.jpg?w=2048") no-repeat center center;
background-size: cover; } }
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.something {
background: url("http://images.contentful.com/space_id/asset_id/token/name.jpg?w=2048") no-repeat center center;
background-size: cover; } }
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
.something {
background: url("http://images.contentful.com/space_id/asset_id/token/name.jpg?w=3072") no-repeat center center;
background-size: cover; } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment