Check out example codes for "how to write if condition in css". It will help you in understanding the concepts better.

Code Example 1

$type: monster;
p {
  @if $type == ocean {
    color: blue;
  } @else if $type == matador {
    color: red;
  } @else if $type == monster {
    color: green;
  } @else {
    color: black;
  }
}

Learn ReactJs, React Native from akashmittal.com