Skip to content

Instantly share code, notes, and snippets.

@gotbahn
Last active August 23, 2016 20:55
Show Gist options
  • Save gotbahn/a13979ef273c90f46008633221d1a976 to your computer and use it in GitHub Desktop.
Save gotbahn/a13979ef273c90f46008633221d1a976 to your computer and use it in GitHub Desktop.
Combine & handle Media Queries in Less
@break-small: 768px;
@break-large: 1024px;
.foo {
color: red;
}
.bar {
color: red;
}
.media-mixin(@break) when (@break = @break-small) {
.foo {
color: green;
}
.bar {
color: palegreen;
}
}
.media-mixin(@break) when (@break = @break-large) {
.foo {
color: blue;
}
.bar {
color: lightblue;
}
}
@media all and (min-width: @break-small) {
.media-mixin(@break-small);
}
@media all and (min-width: @break-large) {
.media-mixin(@break-large);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment