Variables
Variables in Sass are not an advanced topic. They're one of the first things we start using in Sass. However, there are a few things you should understand about variables in Sass which are different to other languages. These include the !default flag and also how Sass handles scope.
!default
When you work on any medium-to large-sized Sass project you will want to make your project configurable from one place. The easiest way to achieve this is with well-made mixins and functions and, of course, variables.
Working on large projects can leave you with dozens and dozens of variables ranging from colors to padding, margins, font families, and font sizes. These might be used throughout your project or they may only need a few files (or one file). Some of these variables might only be used in one or two mixins or functions; however, these mixins and functions will need those variables in order to work.
This is where the !default
flag is extremely useful. While working on a project you will...