<div class="colored">
  aaa
</div>
$color: green;

div.colored {
  @if $color == blue {
    color: white;
    background-color: blue;
  }
  @else if $color == yellow {
    color: white;
    background-color: yellow;
  }
  @else if $color == green {
    color: white;
    background-color: green;
  }
  @else {
    color: white;
    background-color: red;
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.