Multiple parameters in LESS functions
In LESS functions, you can pass multiple parameters. To do this, you need to list them separated by commas. For example, let's make a function size
, which sets the size of an element:
.size(@w, @h) {
width: @w;
height: @h;
}
Let's use our function:
div {
.size(200px, 100px);
}
As a result, after compilation you will get the following code:
div {
width: 200px;
height: 100px;
}
Create a function .fsh
, which will take the value of the font-size
property as its first parameter, and the value of the line-height
property as its second parameter.
Create a function .absTL
that will set absolute positioning. In this case, its first parameter will be the value of the top
property, and the second parameter will be the value of the left
property.
Make similar functions .absTR
, .absBL
and .absBR
, which set absolute positioning from different sides.