d
Amit DhamuSoftware Engineer
 

If Statements in SASS

1 minute read 00000 views
/**
 * Change background colour
 * Set text colour to black unless background colour is black, then set text to white
 */
@mixin change-background($colour) {
  background-color: $colour;

  @if ($colour) == 'black' {
    color: white;
  } @else {
    color: black;
  }
}