Skip to content

Instantly share code, notes, and snippets.

@epicserve
Created November 25, 2014 21:55
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 epicserve/b2623115737117555997 to your computer and use it in GitHub Desktop.
Save epicserve/b2623115737117555997 to your computer and use it in GitHub Desktop.
/**
* MEDIA QUERY VARIABLES
* ------------------------------------------------------------------------- */
$tablet_landscape_width: "1024px";
$tablet_portrait_width: "768px";
$phone_landscape_width: "667px";
$phone_portrait_width: "375px";
/**
Mixin for Media Queries
Example Usage
#foo {
color: #fff;
@include mq(tablet_l) {
color: #ccc;
}
@include mq(tablet_l) {
color: #ddd;
}
}
*/
@mixin mq($mq_slug) {
@if $mq_slug == tablet_l {
@media (max-width: $tablet_landscape_width) { @content; }
}
@else if $mq_slug == tablet_p {
@media (max-width: $tablet_portrait_width) { @content; }
}
@else if $mq_slug == phone_l {
@media (max-width: $phone_landscape_width) { @content; }
}
@else if $mq_slug == phone_p {
@media (max-width: $phone_portrait_width) { @content; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment