Created
October 15, 2014 21:08
-
-
Save mattdrose/ce19003bb85e61f1770c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.5) | |
// Compass (v1.0.1) | |
// ---- | |
@function map-deep-merge($map1, $map2) { | |
$return: $map1; | |
@each $key, $value in $map2 { | |
@if map-get($return, $key) != null and type-of($value) == map and type-of(map-get($return, $key)) == map { | |
$value: map-deep-merge(map-get($return, $key), $value); | |
} | |
$return: map-merge($return, ($key: $value)); | |
} | |
@return $return; | |
} | |
@each $yup, $nope in map-get( | |
map-deep-merge(( | |
foo: ( | |
bar: bar, | |
bat: bat | |
) | |
), ( | |
foo: ( | |
cat: cat, | |
bar: yup | |
) | |
)), foo) { | |
.#{$yup}-#{$nope} {display:none;} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.bar-yup { | |
display: none; | |
} | |
.bat-bat { | |
display: none; | |
} | |
.cat-cat { | |
display: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment