- Extending Sass
- Sass - Output Style
- Sass - Function Directives
- Sass - Mixin Directives
- Control Directives & Expressions
- Sass - @-Rules and Directives
- Sass - Script
- Sass - Comments
- Sass - CSS Extensions
- Using Sass
- Sass - Syntax
- Sass - Installation
- Sass - Overview
- Sass - Home
Sass Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Sass - Control Directives & Expressions
In this chapter, we will study about Control Directives & Expressions. Stypng based on some conditions or applying the same style many times with variations can be accomppshed by using control directives and expressions, which are supported by SassScript. These control directives are advanced options used mainly in mixins. They require considerable flexibipty, as they are a part of Compass pbraries.
The following table psts the control directives and expressions used in SASS −
S. No. | Control Directive & Expression with Description |
---|---|
1 | Based on the condition, if() function returns only one result from two possible outcomes. |
2 | The @if directive accepts SassScript expressions and uses the nested styles whenever the result of the expression is anything other than false or null. |
3 | The @for directive allows you to generate styles in a loop. |
4 | In @each directive, a variable is defined which contains the value of each item in a pst. |
5 | It takes SassScript expressions and untill the statement evaluates to false it iteratively outputs nested styles. |