Skip to content

Instantly share code, notes, and snippets.

@seven-phases-max
Created April 25, 2014 03:33
Show Gist options
  • Select an option

  • Save seven-phases-max/11277015 to your computer and use it in GitHub Desktop.

Select an option

Save seven-phases-max/11277015 to your computer and use it in GitHub Desktop.
.animal(@color: whatever, @imgWidth: null) {
& when (iscolor(@color)) {color: @color}
img when (isnumber(@imgWidth)) {width: @imgWidth}
}
@media screen and (max-width: 20em) {
.animal(@color: red, @imgWidth: 3em);
}
@media screen and (min-width: 21em) {
.animal(@imgWidth: 5em);
}
@media print {
.animal(@color: black);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment