As also seen in the Setting the properties of CSS styles with mixins recipe in Chapter 1, Getting to Grips with the Basics of Less and the Using parametric mixins recipe in Chapter 3, Using Variables and Mixins, mixins can take arguments, which are variables passed to the block of selectors when it is mixed in. The mixin in the recipe in Chapter 1, Getting to Grips with the Basics of Less, accepts a single parameter as argument only, but mixins can be built to accept more than one parameter. In this section, you will learn how to use mixins with more than one parameter.
For this recipe, you will have to create a Less file, for instance, mixins.less
. You can compile this mixins.less
file with the command-line lessc
compiler, as described in the Installing the lessc compiler with npm recipe in Chapter 1, Getting to Grips with the Basics of Less.