Skip to content

Instantly share code, notes, and snippets.

@KittyGiraudel
Created July 2, 2014 14:24
Show Gist options
  • Select an option

  • Save KittyGiraudel/b294f899642a7545bc62 to your computer and use it in GitHub Desktop.

Select an option

Save KittyGiraudel/b294f899642a7545bc62 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.9)
// Compass (v1.0.0.alpha.20)
// ----
// Define a default map
$configuration: (
"option": "default"
) !global;
// Define an empty map of custom parameters
$custom: ();
// Whenever a function/mixin needs the option map,
// Merge the custom conf to the default conf
@mixin test() {
$options: map-merge($configuration, $custom);
$option: map-get($options, "option");
option: $option;
}
// With default values
test {
@include test();
}
// Update custom map with your own options
$custom: map-merge($custom, ("option": "value")) !global;
// With custom values
test {
@include test();
}
test {
option: "default";
}
test {
option: "value";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment