$name: value; — use for colors, spacing, fonts. Compile replaces variables with literals in CSS output.
Going deeper
In production Sass work, Variables matters when documents, stylesheets, or apps must stay maintainable across teams and releases—not only in isolated demos.
Common pitfalls
Watch for copy-paste configs, skipping validation or tests, and mixing concerns (structure vs presentation vs behavior) in one layer.
Practice
- Apply one technique from this lesson in the playground.
- Write one interview-style sentence explaining when you would use variables on a real project.
Challenge
Theme colors
- Define
$brandand$text. - Style
.demo-card__titleand.demo-card__btnwith them. - Compile and check preview.
Done when: preview shows your brand color on title and button.