Write maintainable CSS with variables, nesting, mixins, modules, maps, and compiled output.
Lessons
Produce light and dark themes from token maps.
Generating Theme Variants 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 Generating Theme Variants example in a small scratch file, then explain what changed and why.