Created
November 4, 2015 18:05
-
-
Save Jessica7/7aa0aedfda32f23e1d87 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or 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
| // ---- | |
| // libsass (v3.2.5) | |
| // ---- | |
| /* Generating a Map */ | |
| $map: ( | |
| key: value, | |
| nextkey: nextvalue | |
| ); | |
| /* How to get a Value */ | |
| .element:before { | |
| content: map-get($map, key); | |
| } | |
| /* How to check if a key is Available */ | |
| $map: ( | |
| key: value, | |
| nextkey: nextvalue | |
| ); | |
| .element { | |
| @if map-has-key($map, key) { | |
| content: 'M has this key.'; | |
| } @else { | |
| content: ' has not this key.'; | |
| } | |
| } | |
| /* How to merge maps Together */ | |
| $colors: ( | |
| light: #ccc, | |
| dark: #000 | |
| ); | |
| $brand-colors: ( | |
| main: red, | |
| alternative: blue | |
| ); | |
| // Merge maps | |
| $merged: map-merge($colors, $brand-colors); | |
| .element { | |
| content: map-get($merged, dark); | |
| } | |
This file contains hidden or 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
| /* Generating a Map */ | |
| /* How to get a Value */ | |
| .element:before { | |
| content: value; | |
| } | |
| /* How to check if a key is Available */ | |
| .element { | |
| content: 'M has this key.'; | |
| } | |
| /* How to merge maps Together */ | |
| .element { | |
| content: #000; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment