Chapter 5Loops and Conditions

Our journey with Sass is going well so far, don’t you think? We now have a solid understanding of variables, and know about functions and mixins.

Mixins and functions usually involve logic to perform well. For instance: “do this in this condition, or do that,” or “iterate over this list to perform some action.” That’s why this chapter will be dedicated to Sass logic handlers: loops and conditions.

Conditional statements represent the simplest control structures, and more often that not, you’ll need them to use loops effectively. Therefore we’ll start with that right away, if you don’t mind (see what I did there?).

Conditions

Conditions are a pillar of any piece of software ever written. Even outside of the computer ...

Get Jump Start Sass 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.