Skip to content

Instantly share code, notes, and snippets.

@KittyGiraudel
Created August 7, 2015 07:53
Show Gist options
  • Save KittyGiraudel/60f8e5d1f035e26e97c4 to your computer and use it in GitHub Desktop.
Save KittyGiraudel/60f8e5d1f035e26e97c4 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@function map-combine($source, $map) {
@each $key, $value in $map {
$new: ($key: $value);
@if map-has-key($source, $key) {
$current: map-get($source, $key);
$new: ($key: append($current, $value, list-separator($current)));
}
$source: map-merge($source, $new);
}
@return $source;
}
$map-1: (
'foo': 'bar',
'baz': 'qux'
);
$map-2: (
'foo': 'qux'
);
.foo {
content: inspect(map-combine($map-1, $map-2));
}
.foo {
content: ("foo": "bar" "qux", "baz": "qux");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment