Sass TutorialLesson 4Free preview
Sass Variables
This lesson is part of SASS · All levels
Summary
The Sass variable keeps values such as colors, fonts, or spaces in one place with the prefix dollar sign. The values can be used repeatedly and modified centrally to make the style sheet more consistent. Sass also provides some scope, namely global, local within the block, and !global to force the variable out of the block.
Key points
- The Sass variable is declared with the prefix dollar sign, example $color: #333;
- The value can be color, number, string, list, or map
- Local scope applies within the constrained block where the variable is defined
- Reassignment to a global variable without a global making a local copy
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.