Skip to content

Instantly share code, notes, and snippets.

@lunelson
Last active January 26, 2016 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lunelson/95772c42cf7fc2a00cd2 to your computer and use it in GitHub Desktop.
Save lunelson/95772c42cf7fc2a00cd2 to your computer and use it in GitHub Desktop.
mixin option-map pattern
// ----
// Sass (v4.0.0.alpha.1)
// ----
@mixin foo($opts: null, $bar: 1, $baz: 2, $bif: 3) {
@if $opts { @include foo($opts...); } @else {
bar: $bar;
baz: $baz;
bif: $bif;
}
}
.test {
@include foo((bar: 5, bif: 1));
}
.test {
bar: 5;
baz: 2;
bif: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment