Single line if in Sass

Instead of writing an if else statement Sass can handle single line ifs as well. If the crew is less then 4 people the color will go green otherwise red. Note that lists in Sass/Scss starts on 1 and not 0!

$crew: judy phillip william emily;

.worksite {
  color: if(length($crew) < 5, green, red);
}

Add your comment