non-destructive-map-merge
v1.0.0
Published
A non-destructive-map-merge function for Sass
Downloads
1
Readme
non-destructive-map-merge
A non-destructive-map-merge function for Sass
Credit: https://medium.com/@pentzzsolt/a-non-destructive-map-merge-function-for-sass-f91637f87b2e#.ekepo95qi
Example
$global-colors: (
neutral: (
x-light: #f1f1f1,
),
primary: #df2,
secondary: (
base: (
old: red,
new: green
)
),
tertiary: (
base: yellow
)
);
$local-colors: (
neutral: grey,
primary: (
light: #738bd3,
base: #042f75
),
secondary: (
light: #ffa75b
),
tertiary: (
light: (
first: orange,
second: purple
),
),
success: (
base: #007b39
)
);
$colors: non-destructive-map-merge($global-colors, $local-colors);
//Expected result:
//$colors: (
// neutral: grey,
// primary: (
// light: #738bd3,
// base: #042f75
// ),
// secondary: (
// base: (
// old: red,
// new: green
// ),
// light: #ffa75b
// ),
// tertiary: (
// base: yellow,
// light: (
// first: orange,
// second: purple
// )
// ),
// success: (
// base: #007b39
// )
//);