LESS stands for Leaner Style Sheets. It is a backward-compatible language extension for CSS. Web pages can be styled by writing appropriate code in a file with .less extension and then converting it in a CSS file.
Steps to install LESS:
Step 1: To install LESS, first make sure that node and npm are already installed in the system. If not, then install them using the instructions given below.
- Download the latest version of node in the system and install it.
- Now open command prompt and move to your project folder.
- Now you need to create a package.json file to manage the dependencies. To do so, use the command given below.
After which you will be asked for the package name of the user’s choice and the description. For other formalities, just press enter and your package.json file will be created.
Step 2: Now install LESS using the command:
npm install less
Note: Install the LESS npm module globally so that it can be used by any project, use the command npm install less -g. If you are executing this on a Mac or Linux machine, you may need to add “sudo” to the beginning of this command.
Step 3: To compile .less file, use the command:
lessc input.less output.css
Note: Make sure that you run this command in the same folder which contains input.less file. This completes the compilation of the LESS file to CSS file which can now be added to the HTML file.
- How to import SASS through npm ?
- Node.js | NPM (Node Package Manager)
- How to install the previous version of node.js and npm ?
- What are the differences between npm and npx ?
- Steps to Create and Publish NPM packages
- How to use External Modules and NPM in a project ?
- Difference between npm and yarn
- ReactJS | Basics of ES, Babel and npm
- How to update NPM ?
- Introduction to NPM scripts
- What is the meaning of --save for NPM install ?
- How to update Node.js and NPM to next version ?
- Node.js NPM arraybuffer-to-string Module
- Node.js NPM string-to-arraybuffer Module
- Node.js NPM shortid Module
- Node.js NPM uuid
- How to install modules without npm in node.js ?
- Difference between node.js require and ES6 import and export
- CSS | @import rule
- What is the best way to include CSS file? Why use @import?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.