Slide 43
Slide 43 text
// Colour map
$colors: (
crimson: #c00,
mustard: #fc0,
neutral: (
darkest: #222;
darker: #444;
dark: #666;
base: #888;
light: #bbb;
lighter: #ddd;
lightest: #eee;
)
);
// Helper
@function color($name, $var: null) {
@if ($var != null) {
@return map-get(map-get($colors, $name), $var);
} @else {
@return map-get($colors, $name);
}
}
// Usage example
.c-module__title {
color: color(neutral, darkest);
}