From the course: Sass Essential Training

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Mixins

Mixins

“

- [Instructor] SaaS also lets you do something similar to JavaScript functions. Now these are called mixins and are super flexible. To use them, you start by adding a @mixin rule right here and then we can give it a name and pass along some parameters. So those are arguments and you can add as many arguments as you want in here. And you can see that I'm also including a default value just in case somebody doesn't include a value for this argument right here. You can see that I'm calling the mixin here without passing along any values, but that I can also pass along a value. You can even pass just the value. You don't have to specify the variable. So you can actually call these by their individual names or pass along a series of different parameters with commas, just like you would with JavaScript functions. To use them, of course, you've seen that we're using the include at-rule and then we just include the mixin that we…

Contents