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

No sure what I’m doing wrong here. Need help

Your code so far

<style type='text/scss'>

@mixin border-stroke($val){
@if $val==light {
  border-stroke:1px solid black;
}
@else if $val==medium {
  border-stroke:3px solid black;
}
@else if $val==heavy {
  border-stroke:6px solid black;
}
@else{
  border-stroke:none;}
}

  #box {
    width: 150px;
    height: 150px;
    background-color: red;
    @include border-stroke(medium);
  }
</style>

<div id="box"></div>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

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

Link to the challenge:

I found the issue. Although the mixin is called border stroke, the actual css is just border

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.