CHAPTER 2

image

Introduction to Sass

In the previous chapter, you learned about precompilers, including why to use them, which ones are the known preprocessors, and their features. This chapter covers one of the most popular preprocessors: Sass.

In this chapter, you explore the following aspects of Sass:

  • Installation
  • Running the code
  • Variables
  • Comments
  • Data types
  • Parentheses
  • Nested rules
  • Nested properties
  • Referencing parent selector
  • Interpolation
  • Placeholder selector
  • Logical and control directives

Installing Sass

You install Sass via a Ruby gem, so you need to have Ruby installed on your machine. If you are on Mac OS X, you already have Ruby installed. If you are ...

Get Beginning CSS Preprocessors: With SASS, Compass.js, and Less.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.