Ukázka zanořeného map objectu - SCSS (2 rozměrný)
<div class="a">kuku</div>
.a {
color: red;
margin: 20px;
position: static;
}
// ----
// 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);
}
<div class="a">kuku</div>