![]() |
VOOZH | about |
Less.js is a simple CSS pre-processor that facilitates the creation of manageable, customizable, and reusable style sheets for websites. It is chosen because CSS is a dynamic style sheet language. LESS is flexible, thus it functions with a variety of browsers. Web browsers can only use CSS that has been written in and processed using the CSS pre-processor, a programming language. It is a CSS language extension that also offers features like variables, functions, mixins, and operations to aid in the creation of dynamic CSS while keeping backward compatibility.
In this article, we are going to discuss the Math pow() function, which is used to return the first argument's value rounded up to the power of the second argument. This function takes two floating numbers as parameters and performs a to the power operation keeping the first number as a base and the second number as an exponent. The returned values have the same dimension as the first parameter and the dimension of the second parameter is ignored.
Syntax:
power(number, number)
Parameters:
Compile LESS code into CSS code.
Example 1: The code below demonstrates the usage and implementation of the Misc pow() function.
styles.less:
Now, to compile the above LESS code to CSS code, run the following command:
lessc styles.less styles.css
The compiled CSS file comes to be:
styles.css:
Output:
Example 2: The code below demonstrates the usage and implementation of the Misc pow() function and the code shows how the dimensions of the first parameter is the dimension of the returned value. We have also used the ispercentage() and the if() and boolean logical functions.
styles.less:
Now, to compile the above LESS code to CSS code, run the following command:
lessc styles.less styles.css
The compiled CSS file comes to be:
styles.css: