sass中的map
$theme-color:(
default:(
bgcolor: #fff,
text-color: #444,
link-color: #39f
),
primary:(
bgcolor: #000,
text-color: #fff,
link-color: #93f
),
negative(
bgcolor: #f36,
text-color: #fefefe,
link-color: #d4e
)
);
@each $i in map-keys($theme-color){
.#{$i}{
background-color:map-get(map-get($theme-color,$i),bgcolor);
color:map-get(map-get($theme-color,$i),text-color);
}
.#{$i} a:link{
color:map-get(map-get($theme-color,$i),link-color);
}
}