Write maintainable CSS with variables, nesting, mixins, modules, maps, and compiled output.
Lessons
Centralize colors, spacing, and type as tokens.
Design Tokens is easiest to learn by reading the example, changing it, and observing the result.
// _tokens.scss - single source of truth
$color: (brand: #4f46e5, ink: #1f2937, paper: #ffffff);
$space: (xs: 4px, sm: 8px, md: 16px, lg: 32px);
$radius: (sm: 4px, md: 8px, pill: 999px);
@use 'sass:map';
.card {
background: map.get($color, paper);
padding: map.get($space, md);
border-radius: map.get($radius, md);
}Practice the Design Tokens example in a small scratch file, then explain what changed and why.