Part 4. Advanced Sass and Compass

 

In the first three sections, you’ve learned the basics of Sass and Compass and how they fit into your stylesheet authoring workflow. In this section, we explore some advanced features of Sass and Compass. In chapter 9, we start off looking at how Sass handles data types and expressions, allowing you to add strings and values, with intelligent unit conversions. We’ll walk you through the many powerful functions for working with numbers, lists, and colors. You’ll see how Sass can easily manipulate colors, giving you the ability to do dynamic theming right in your stylesheets. You’ll also learn how to write your own Sass functions. Finally, we look at how to write loops with @for, @while, and @each and how to do conditional styling with @if and @else directives.