Skip to content

Instantly share code, notes, and snippets.

Created October 28, 2012 17:54
Show Gist options
  • Select an option

  • Save anonymous/3969280 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/3969280 to your computer and use it in GitHub Desktop.
// LESS mixins with default parameters; write them once use them everywhere
// i am not going to write out all the mixins, but you get the point
.border-top (@color: #ccc, @width: 1px, @style: solid) { border-top: @arguments; }
.border-right (@color: #ccc, @width: 1px, @style: solid) { border-right: @arguments; }
.border-bottom (@color: #ccc, @width: 1px, @style: solid) { border-bottom: @arguments; }
.border-left (@color: #ccc, @width: 1px, @style: solid) { border-left: @arguments; }
// mixin of mixins
.borders (@color: #ccc, @width: 1px, @style: solid) {
.border-top(@color, @width, @style);
.border-right(@color, @width, @style);
.border-bottom(@color, @width, @style);
.border-left(@color, @width, @style);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment