Skip to content

Instantly share code, notes, and snippets.

@soutar
Last active August 29, 2015 14:01
Show Gist options
  • Save soutar/adcd7d7b11b619dc7498 to your computer and use it in GitHub Desktop.
Save soutar/adcd7d7b11b619dc7498 to your computer and use it in GitHub Desktop.
LESS: Combine mixins, bubbling and ruleset params to create more readable media queries
.branding {
display: block;
.between(@grid-float-breakpoint, @screen-md, {
display: none;
});
}
.between(@min, @max, @rules) {
@media screen and (min-width: @min) and (max-width: @max) {
@rules();
}
}
.min-width(@min, @rules) {
@media screen and (min-width: @min) {
@rules();
}
}
.max-width(@max, @rules) {
@media screen and (max-width: @max) {
@rules();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment