Sass @if @else Rules
Sass @if @else Rules
In Sass @if @else
rules, the @if
rule controls whether or not to evaluate its block. The expression usually returns either true or false—if the expression returns true, the block of code under @if
rule is evaluated, and if the expression returns false, the block of code under @else
rule is evaluated.
Example
Syntax
Real World Example
The following example will clearly define the scenario to use @if @else
rules.
Example
Reminder
Hi Developers, we almost covered 99.1% of Sass Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in Sass.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.