Skip to content

Instantly share code, notes, and snippets.

@jonathan-beebe
Created April 15, 2014 21:13
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 jonathan-beebe/10775613 to your computer and use it in GitHub Desktop.
Save jonathan-beebe/10775613 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
// Define items
$brand-bright: (
name: bright,
color: yellow
);
$brand-dark: (
name: dark,
color: black
);
// Create collection from items
$brands: (
$brand-bright,
$brand-dark,
);
// Variant Mixin
@mixin brand-variant ($name, $color) {
.brand--#{$name} {
h3 {
color: $color;
}
}
}
// Loop over items, passing the value map as the parameter
@each $item in $brands {
@include brand-variant($item...);
}
.brand--bright h3 {
color: yellow;
}
.brand--dark h3 {
color: black;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment