O'Reilly logo

Mastering Sass by Luke Watts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required