Skip to content

Instantly share code, notes, and snippets.

@rheaton
Created June 15, 2015 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rheaton/bb11860953f28ce71fde to your computer and use it in GitHub Desktop.
Save rheaton/bb11860953f28ce71fde to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$small-only: only screen and (max-width: 40em);
$small-up: only screen; // everything
$medium-only: only screen and (min-width: 40.0625em) and (max-width: 64em);
$medium-up: only screen and (min-width: 40.0625em);
$large-only: only screen and (min-width: 64.0625em) and (max-width: 90em);
$large-up: only screen and (min-width: 64.0625em);
$xlarge-only: only screen and (min-width: 90.0625em) and (max-width: 120em);
$xlarge-up: only screen and (min-width: 90.0625em);
$xxlarge-only: only screen and (min-width: 120.0625em) and (max-width: 6249999.9375em);
$xxlarge-up: only screen and (min-width: 120.0625em);
@mixin retina {
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min--moz-device-pixel-ratio: 2),
only screen and (-moz-min-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
@content;
}
}
#bv-hp-hero.opt-test {
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
#homepage-products-wrapper {
display: none;
}
@media #{$small-only} {
// you could put cover here depending on how you want it to behave
// don't put auto (or if you do, you will need to use something else for retina
// as it is too large for auto to work properly -RH
background-size: contain;
background-image: image-url('test/home-hero-2-small.jpg');
background-position-y: 0;
@include retina {
background-image: image-url('test/home-hero-2-small@2x.jpg');
}
.hp-image-container {
// calculate ratio of small image -RH
min-height: 476px;
}
}
@media #{$medium-up} {
background-image: image-url('test/home-hero-2-medium.jpg');
@include retina {
background-image: image-url('test/home-hero-2-medium@2x.jpg');
}
}
@media #{$xxlarge-up} {
background-size: contain;
background-image: image-url('test/home-hero-2-large.jpg');
@include retina {
background-image: image-url('test/home-hero-2-large@2x.jpg');
}
}
}
#bv-hp-hero.opt-test {
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
}
#bv-hp-hero.opt-test #homepage-products-wrapper {
display: none;
}
@media (max-width: 40em) {
#bv-hp-hero.opt-test {
background-size: contain;
background-image: image-url("test/home-hero-2-small.jpg");
background-position-y: 0;
}
}
@media only screen and (max-width: 40em) and (-webkit-min-device-pixel-ratio: 2), only screen and (max-width: 40em) and (min--moz-device-pixel-ratio: 2), only screen and (max-width: 40em) and (-moz-min-device-pixel-ratio: 2), only screen and (max-width: 40em) and (-o-min-device-pixel-ratio: 2/1), only screen and (max-width: 40em) and (min-device-pixel-ratio: 2), only screen and (max-width: 40em) and (min-resolution: 192dpi), only screen and (max-width: 40em) and (min-resolution: 2dppx) {
#bv-hp-hero.opt-test {
background-image: image-url("test/home-hero-2-small@2x.jpg");
}
}
@media (max-width: 40em) {
#bv-hp-hero.opt-test .hp-image-container {
min-height: 476px;
}
}
@media (min-width: 40.0625em) {
#bv-hp-hero.opt-test {
background-image: image-url("test/home-hero-2-medium.jpg");
}
}
@media only screen and (min-width: 40.0625em) and (-webkit-min-device-pixel-ratio: 2), only screen and (min-width: 40.0625em) and (min--moz-device-pixel-ratio: 2), only screen and (min-width: 40.0625em) and (-moz-min-device-pixel-ratio: 2), only screen and (min-width: 40.0625em) and (-o-min-device-pixel-ratio: 2/1), only screen and (min-width: 40.0625em) and (min-device-pixel-ratio: 2), only screen and (min-width: 40.0625em) and (min-resolution: 192dpi), only screen and (min-width: 40.0625em) and (min-resolution: 2dppx) {
#bv-hp-hero.opt-test {
background-image: image-url("test/home-hero-2-medium@2x.jpg");
}
}
@media (min-width: 120.0625em) {
#bv-hp-hero.opt-test {
background-size: contain;
background-image: image-url("test/home-hero-2-large.jpg");
}
}
@media only screen and (min-width: 120.0625em) and (-webkit-min-device-pixel-ratio: 2), only screen and (min-width: 120.0625em) and (min--moz-device-pixel-ratio: 2), only screen and (min-width: 120.0625em) and (-moz-min-device-pixel-ratio: 2), only screen and (min-width: 120.0625em) and (-o-min-device-pixel-ratio: 2/1), only screen and (min-width: 120.0625em) and (min-device-pixel-ratio: 2), only screen and (min-width: 120.0625em) and (min-resolution: 192dpi), only screen and (min-width: 120.0625em) and (min-resolution: 2dppx) {
#bv-hp-hero.opt-test {
background-image: image-url("test/home-hero-2-large@2x.jpg");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment