Control Directives
In this lesson, we'll be looking at SASS control directives, which allow us to introduce conditionals and looping into our stylesheets.
Definition
Control directives and expressions are used in SASS to include styles only under certain defined conditions.
As a feature, they’re quite advanced and are mainly useful in mixins. Common directives include @if, @else, @for and @while.
@if and @else
The @if and @else directives are similar to if and else statements in JavaScript.
...