Now that we are getting into
SCSS let's look into using variables and the power that comes with them.
Variables are literally what you expect a definition of a value.
These can contain a wide range in
Declaring Variables permalink
To declare variables in
SCSS we use the dollar sign $.
Let's define some variables for todays examples:
$fontFamily: Roboto, 'Helvetica Neue', Arial, sans-serif;
We can then use these variables as such:
This will then result in the following Codepen.
Overwriting Variables permalink
There is an option to overwrite variables inside an element check out the following use case:
What happens here, just inside the H1 we change the color to green, will only make the H1 yellow. The p tag will stay our original color.
There is an option to overwrite the default for good, but I don't know why it exists!
This will give the following Codepen.