Chapter 5. Advanced Sass
In this chapter we'll look at some of the more advanced features of Sass. We'll take a comprehensive look at variables and in particular variable scope and using the !default
and !global
flags. We'll look at the problems which can arise when using local and global scope in mixins, functions, and selectors.
Then we'll look at creating a mixin
which generates pure CSS arrows. To create this mixin
we'll need to use extends and interpolation to dynamically use those extends from within our mixin
. We'll also see how we can simplify checking for multiple values within an if statement using the index function.
We'll then create a mixin which will simplify writing media queries. We'll use the @content
directive which allows us to pass additional properties, mixins, or extends to a mixin.
Lastly, we'll look at using maps. Maps will allow us to group similar variables into a key value set. We'll look at how to retrieve...