Chapter 2. Basic Sass syntax

This chapter covers

  • Reusing colors, lengths, and other values with variables
  • Adding structure to your CSS by nesting rules
  • Writing maintainable stylesheets by distributing them among multiple files
  • Reusing entire styles with mixins and inheritance

Sass’s SCSS syntax is a superset of the syntax of CSS3. This means that if can read and write CSS, you already know the basics of how to read and write Sass.

On top of CSS, Sass adds new features and new syntax that let you express more styles more clearly with less writing. Some Sass additions are designed to be easy to understand for people who understand CSS, even without having seen Sass before. Most of them require some explanation, though, which is what this ...

Get Sass and Compass in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.