Part 1. Getting acquainted with Sass and Compass

 

The first part of this book introduces you to Sass and Compass, looking at Sass’s core and covering some of the principles behind writing dynamic stylesheets. In chapter 1, we look at what it means to author stylesheets dynamically and discuss development principles to help wield this power wisely. You’ll see how Sass simplifies stylesheet authoring by helping you avoid repetition with selector nesting and variables, and how you can intelligently reuse common styles and patterns using @extend and mixins. We discuss the Compass framework and how it provides patterns and tools to make styling websites smooth and efficient.

Chapter 2 helps you get acquainted with the Sass syntax and its many powerful features. We discuss how to use variables in Sass and how scoping works. You’ll learn how nesting selectors and subproperties can make your stylesheets cleaner and easier to read. You’ll see how Sass has improved CSS’s @import to let you combine many stylesheets into one, allowing you to break up your styles into smaller, more manageable files. We look at using mixins to easily share common styles while avoiding repetition, and how to pass arguments and use variables in mixins, making it easy to customize the styles while preserving patterns. You’ll learn to use selector inheritance with @extend, another way to reduce repetition, when to use inheritance and when to use mixins, and best practices.