Skip to content

Instantly share code, notes, and snippets.

@Kcko
Last active August 29, 2015 14:10
Show Gist options
  • Save Kcko/4b856b37fa10ae675af7 to your computer and use it in GitHub Desktop.
Save Kcko/4b856b37fa10ae675af7 to your computer and use it in GitHub Desktop.
Ukázka zanořeného map objectu - SCSS (2 rozměrný)
<div class="a">kuku</div>
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
$config: (
colors: (
first: red,
second: green,
third: blue
),
margins: (
first: 10px,
second: 20px
),
positions: (
first: relative,
second: absolute,
third: static
)
);
@function getConfig($k, $v: 'first') {
@return map-get(map-get($config, $k), $v);
}
.a
{
color: getConfig(colors, first);
margin: getConfig(margins, second);
position: getConfig(positions, third);
}
.a {
color: red;
margin: 20px;
position: static;
}
<div class="a">kuku</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment