calc function in LESS
Let's make a function that will wrap the CSS function calc. Let our function take the property name as its first parameter, and the calculated value as its second:
.calc(@name, @calc) {
@{name}: calc(@calc);
}
Let's use our function:
p {
.calc(width, ~'10px + 30%');
}
Compilation result:
p {
width: calc(10px + 30%);
}
Tell me what the result of compiling the following code will be:
p {
.calc(width, ~'10px + 30%');
.calc(height, ~'10px + 30%');
}