SASS - Use @if and @else to Add Logic To Your Styles

If you take a look at the exercise, you will see you were given sample code.
Here is part of that code:

@mixin text-effect($val) {
  @if $val == danger {
    color: red;
  }

So you already have the first line written down correctly (as I see from the code you posted above)

So now you need an if statement just like the example one given but instead of the word danger, use the word light.
And instead of the word color use the word border.
And instead of the word red use the words “1px solid black”

So all you are doing is following the example given to you but with slightly different checks and slightly different styles.

1 Like