SASS Terniary Expressions | Task

Ole Ersoy
May - 31  -  1 min

Scenario

We want to use a ternary expression in SASS.

Approach

The evaluation of the below expression will set $result to $foreground.

$property: 'text';
$result: if($property == 'text', '$foreground', '$background');
@debug $result;

Demo