Skip to content

Instantly share code, notes, and snippets.

@binary-solo
Created June 15, 2015 12:15
Show Gist options
  • Select an option

  • Save binary-solo/711e0a2df18f10066220 to your computer and use it in GitHub Desktop.

Select an option

Save binary-solo/711e0a2df18f10066220 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
@function map-fetch($map, $keys) {
$key: nth($keys, 1);
$length: length($keys);
$value: map-get($map, $key);
@if ($length > 1) {
$rest: ();
@for $i from 2 through $length {
$rest: append($rest, nth($keys, $i))
}
@return map-fetch($value, $rest)
} @else {
@return $value;
}
}
$notice-boxes: (
types: (
warning: (
border: #dcfac0,
background: #00968b,
),
)
);
@each $type in map-keys(map-get($notice-boxes, types)) {
.notice-box-#{$type} {
background-color: map-fetch($notice-boxes, types $type background);
border: map-fetch($notice-boxes, types $type border);
}
}
.notice-box-warning {
background-color: #00968b;
border: #dcfac0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment