Help this lesson

Tell us what’s happening:

Your code so far


<style type='text/sass'>

div{
@mixin border-radius()

}
#awesome {
  width: 150px;
  height: 150px;
  background-color: green;

}
</style>

<div id="awesome"></div>

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/80.0.3987.87 Chrome/80.0.3987.87 Safari/537.36.

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! Glad to see you’re trying to work through this challenge.

When using SASS, @mixin means you’re defining a function. The function that you’re defining border-radius() will be used similar to how you use CSS.

So step one, I would remove the div {} that is surrounding @mixin border-radius
This means that you’re defining a function named border-radius.

Next they are looking for you to create a parameter for the border-radius @mixin.
To pass a parameter into a @mixin you need to add it between the two parenthesis.

An example could look something like @mixin myMixin($param1, $param2) {}
This then gives you the ability to use $param1 and $param2 inside of your myMixin.

I hope this gives you the extra nudge towards completing the challenge! Looking forward to seeing you complete it.

1 Like