Using the default() function
The built-in default() function plays a special role when leveraging mixins, especially mixin guards.
Getting ready
For this recipe, you will have to know something about parameterized mixins. You also need to be aware of what guards are and how to use them. You can find both in the Using mixin guards recipe in Chapter 6, Advanced Less Coding. You will also need a Less compiler, as discussed in Chapter 1, Getting to Grips with the Basics of Less.
How to do it…
- Use the command-line 
lessccompiler to compile the following Less code:.mixin(1) { property: 1 * 2; } .mixin(2) { property: 2 * 3; } .mixin(@a) when (default()) { property: @a; } one { .mixin(1); } five { .mixin(5); } - The preceding Less code compiles into CSS, which looks like the following code:
one { property: 2; } five { property: 5; } 
How it works…
The default() function returns true for the situation if no other mixin matches. Note that the default() function can only be used in...