Write maintainable CSS with variables, nesting, mixins, modules, maps, and compiled output.
Lessons
Generate a consistent spacing system from a map.
Building a Spacing Scale is easiest to learn by reading the example, changing it, and observing the result.
$brand: #4f46e5;
$space: 1rem;
@mixin card {
border-radius: 8px;
padding: $space;
box-shadow: 0 10px 30px rgb(15 23 42 / .12);
}
.lesson-card {
@include card;
border-color: $brand;
&:hover {
box-shadow: 0 14px 40px rgb(15 23 42 / .18);
}
}Practice the Building a Spacing Scale example in a small scratch file, then explain what changed and why.