Write maintainable CSS with variables, nesting, mixins, modules, maps, and compiled output.
Lessons
Iterate over lists and maps to generate rules.
The @each Loop is easiest to learn by reading the example, changing it, and observing the result.
$colors: (
primary: #4f46e5,
success: #10b981,
danger: #ef4444,
);
@each $name, $value in $colors {
.text-#{$name} { color: $value; }
.bg-#{$name} { background: $value; }
}Practice the The @each Loop example in a small scratch file, then explain what changed and why.