Write maintainable CSS with variables, nesting, mixins, modules, maps, and compiled output.
Lessons
Combine Sass variables and runtime CSS variables.
Sass with CSS Custom Properties is easiest to learn by reading the example, changing it, and observing the result.
$brand: #4f46e5;
:root {
// Pass a Sass value into a runtime CSS custom property
--brand: #{$brand};
--space: #{16px};
}
.button {
background: var(--brand);
padding: var(--space);
}Practice the Sass with CSS Custom Properties example in a small scratch file, then explain what changed and why.