Skip to content

Instantly share code, notes, and snippets.

@Jessica7
Created November 4, 2015 18:05
Show Gist options
  • Select an option

  • Save Jessica7/7aa0aedfda32f23e1d87 to your computer and use it in GitHub Desktop.

Select an option

Save Jessica7/7aa0aedfda32f23e1d87 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// 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);
}
/* 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