Write maintainable CSS with variables, nesting, mixins, modules, maps, and compiled output.
Lessons
Apply conventions that keep stylesheets maintainable.
Sass Best Practices is easiest to learn by reading the example, changing it, and observing the result.
// Prefer @use over @import (loads each module once)
@use 'sass:map';
// Keep nesting shallow (3 levels max) for low specificity
.card {
&__title { font-weight: 700; }
}
// Reuse with placeholders and mixins instead of copy-paste
%visually-hidden { position: absolute; clip: rect(0 0 0 0); }Practice the Sass Best Practices example in a small scratch file, then explain what changed and why.