Sass Course #8. Parametric mixins in Sass – .com

In this eighth lesson of the Sass course we will learn what parametric mixins are and how they work in our Sass code.

In the previous class of this course we learned about mixins. We saw that they are helper classes that incorporate a set of CSS rules that are repeated throughout the code.

And in this lesson, we go a step further and introduce the concept of parametric mixins. These are nothing more than mixins like the ones we already know with the particularity that we can pass them one or several parameters that we define ourselves.

In this way, we can take the power of traditional mixins one step further, turning them into authentic dynamic layout rules. Go for it!

Clever! In the video we have learned how to transform a parameter entered in a mixin from pixels to rems easily. Once again, we invite you to download the class code from the link that we have left below the video.

In addition, we have also seen how to create a parametric mixin, which has four parameters that substitute for four values ​​of a selector.

Now, whenever we write our mixins and power them with parameters, Sass will automatically transform those parameters into the values ​​we’ve defined throughout the code.

As always, if you have any doubt or question, you can send it through the support form of the subscriber intranet. See you in the next lesson! 🙂

Remember that if you will have access to everybody the courses and you can also enjoy everything from .

See also  WordPress hosting comparison |

All chapters in this course:

Loading Facebook Comments ...
Loading Disqus Comments ...