Last active
October 30, 2015 17:44
-
-
Save craigmdennis/2cf652a90e01129e87ca to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
$tablet: 'min-width: 48em'; | |
$desktop: 'min-width: 62em'; | |
$upto-desktop: 'max-width: 61.9375em'; | |
@mixin media( $breakpoint ) { | |
@media screen and ( #{$breakpoint} ) { | |
@content; | |
} | |
} | |
@mixin rwd( $classes: (), $breakpoints: () ) { | |
@content; | |
@for $i from 1 through length($classes) { | |
$breakpoint: nth($breakpoints, $i); | |
&---#{nth($classes, $i)} { | |
@include media( $breakpoint ) { | |
@content; | |
} | |
} | |
} | |
} | |
.some-class { | |
@include rwd( at-tablet at-desktop, $tablet $desktop ) { | |
background: blue; | |
} | |
} | |
.another-class { | |
@include rwd( upto-desktop, $upto-desktop ) { | |
background: red; | |
} | |
} |
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
.some-class { | |
background: blue; | |
} | |
@media screen and (min-width: 48em) { | |
.some-class---at-tablet { | |
background: blue; | |
} | |
} | |
@media screen and (min-width: 62em) { | |
.some-class---at-desktop { | |
background: blue; | |
} | |
} | |
.another-class { | |
background: red; | |
} | |
@media screen and (max-width: 61.9375em) { | |
.another-class---upto-desktop { | |
background: red; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment