Overview - Variable declaration with $
What is it?
In Sass, variables are declared using the $ symbol followed by a name and a value. These variables store values like colors, sizes, or fonts that you want to reuse throughout your stylesheets. Using variables helps keep your styles consistent and easy to update. Instead of repeating the same value many times, you just change it once in the variable.
Why it matters
Without variables, you would have to write the same colors or sizes over and over in your CSS. This makes it hard to update your design because you must find and change every instance manually. Variables save time and reduce mistakes by letting you change a value in one place and have it update everywhere. This makes your stylesheets cleaner and easier to maintain.
Where it fits
Before learning Sass variables, you should understand basic CSS syntax and how styles apply to HTML elements. After mastering variables, you can learn about Sass features like nesting, mixins, and functions, which build on variables to create powerful, reusable styles.