Skip to content

Instantly share code, notes, and snippets.

@matiassingers
Last active December 21, 2015 17:28
Show Gist options
  • Save matiassingers/6340278 to your computer and use it in GitHub Desktop.
Save matiassingers/6340278 to your computer and use it in GitHub Desktop.
SASS media query mixin structuring.
@mixin galaxyPocket
@media only screen and (max-width: 300px)
@content
/* Now we just need SASS to combine media queries, or implement something like @buffer: https://github.com/nex3/sass/issues/116 */
.ad-box {
color: black;
}
@media only screen and (max-width: 300px) {
.ad-box {
padding: 3.5px;
}
}
.ad-box.slim {
padding: 7px 21px;
}
@media only screen and (max-width: 300px) {
.ad-box.slim {
padding: 3.5px;
}
}
@import "media-queries"
$standard-padding: 7px
.ad-box
color: black
@include galaxyPocket
padding: $standard-padding / 2
&.slim
padding: $standard-padding $standard-padding*3
@include galaxyPocket
padding: $standard-padding / 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment