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:
styles.less.calc(@name, @calc) {
@{name}: calc(@calc);
}
Let's use our function:
styles.lessp {
.calc(width, ~'10px + 30%');
}
Compilation result:
styles.cssp {
width: calc(10px + 30%);
}
Задание 1
Tell me what the result of compiling the following code will be:
styles.lessp {
.calc(width, ~'10px + 30%');
.calc(height, ~'10px + 30%');
}