Sass: Create Reusable CSS (Mixins)

Tell us what’s happening:
I cant pass this challenge.:unamused::unamused:

Your code so far

#awesome {
width: 150px;
height: 150px;
background-color: green;
@include border-radius($radius);
}




**Your browser information:**

User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36</code>.

**Challenge:** Create Reusable CSS with Mixins

**Link to the challenge:**
https://www.freecodecamp.org/learn/front-end-libraries/sass/create-reusable-css-with-mixins

Hello~!

You’re off to a good start here, but let me try to point you in the right direction :slight_smile:

@include border-radius($radius);
You’re assigning the border-radius mixin to the #awesome element with this line, which is correct - but instead of $radius you need to pass the value that the instructions give: 15px.

However, you also need to define the border-radius mixin above the #awesome section. Follow the example in the instructions for defining a mixin:

@mixin box-shadow($x, $y, $blur, $c){ 
  -webkit-box-shadow: $x $y $blur $c;
  -moz-box-shadow: $x $y $blur $c;
  -ms-box-shadow: $x $y $blur $c;
  box-shadow: $x $y $blur $c;
}
  1. You need to create a mixin first
@mixin box-shadow($x, $y, $blur, $c){ 
  -webkit-box-shadow: $x $y $blur $c;
  -moz-box-shadow: $x $y $blur $c;
  -ms-box-shadow: $x $y $blur $c;
  box-shadow: $x $y $blur $c;
}
  1. apply it to some selector and pass in actual value(s) for your variable(s)
div {
  @include box-shadow(0px, 0px, 4px, #fff);
}

$x becomes 0px, $y = 0px, $blur = 4px, $c = #fff;
3. and it generates code

div{
  -webkit-box-shadow: 0px 0px 4px #fff;
  -moz-box-shadow: 0px 0px 4px #fff;
  -ms-box-shadow: 0px 0px 4px #fff;
  box-shadow: 0px 0px 4px #fff;	
}

Profit :wink:

Thanks for the reply. Was very helpful

Thanks.

Cheers

It is not a matter of adding 15px to the include portion of the code and mixin alone right? What else needs to be done? Thanks for your help.

You mean this issue? That’s pretty much all.
I’m still trying to find the perfect balance or choose between teaching and just giving answers :slight_smile: