mirror of https://github.com/vizality/vizality
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
501 B
12 lines
501 B
@function non-destructive-map-merge($parent-map, $child-map) {
|
|
$result: $parent-map;
|
|
@each $key, $value in $child-map {
|
|
@if (not map-has-key($result, $key)) or (type-of(map-get($result, $key)) != type-of($value)) or (not (type-of(map-get($result, $key)) == map and type-of($value) == map)) {
|
|
$result: map-merge($result, ($key: $value));
|
|
}
|
|
@else {
|
|
$result: map-merge($result, ($key: non-destructive-map-merge(map-get($result, $key), $value)));
|
|
}
|
|
}
|
|
@return $result;
|
|
} |