Write maintainable CSS with variables, nesting, mixins, modules, maps, and compiled output.
Lessons
Understand local, global, and !global variable scope.
Variable Scope is easiest to learn by reading the example, changing it, and observing the result.
$global: 1rem; // global by default
.card {
$local: 2rem; // local to this block
padding: $local;
}
.panel {
$global: 3rem !global; // reassign the global variable
margin: $global;
}Practice the Variable Scope example in a small scratch file, then explain what changed and why.