mq() is a Sass component that helps manipulating media queries in an elegant way.
This add-on mixin uses Jacket, as a pragmatic alternative to $mq-static-breakpoint, to rasterize @media queries. This allows you to be fastidious as to which @media context should be rasterized, instead of relying on a named-breakpoint representing a specific layout range.
With Bower
bower install jacket --save-devbower install mcaskill/sass-mq --save-devbower install jacket-mq=https://gist.github.com/mcaskill/89944b7ef12f37c85c05.git --save-dev
Or Download
Import the three in your stylesheet, in the respective order above. Follow the instructions outlined in mq() for setting up the mixin. Remove any preferences for $mq-responsive and $mq-static-breakpoint.
mj() uses two variables that can be overriden in your own preferences before the _mj file is imported:
$mq-jacket-support: Context for those that support@mediaqueries. Defaults tohas-mediaqueries.$mq-jacket-legacy: Context for those that don't support@media. Defaults tohas-no-mediaqueries.
Afterwards, follow the instructions outlined in Jacket to define your contexts.
$jacket: $mq-jacket-legacy, ie8;
// [...]
#foo {
content: 'Basic Styling';
// This won't be compiled:
@include mq($from: mobile) {
color: lawngreen;
}
// This will be compiled:
@include mj($until: tablet) {
color: indianred;
}
}