Javatpoint Logo

91-9990449935

 0120-4256464

Javatpoint Logo

Less Commands

To install Less on the server via NPM:

To invoke the compiler from the command-line, after installing Less:

To compile the Less file and generate CSS:

To get minified CSS as output, you can use the clean-css plugin. After the installation of that plgin, a minified CSS output is specified with --clean-css option:

To get CSS output on Console:

Syntax:

Output:

Pass options to the compiler:

Syntax:


Important Tips:

  • You must include your stylesheets before your script.
  • When you link more than one .Less stylesheet each of them is compiled independently. So variables, mixins or namespaces which are defined in a stylesheet are not accessible in any other.
Next TopicLess Installation




Share this page

facebook twitter google plus pinterest tumbler

Latest 4 Tutorials