Erik
Erik

Reputation: 5791

What is the purpose of the less.js and styles.less

Can someone explain why I would want to use the less.js script along with its stylesheet? I don;t understand the purpose and its advantages. Thank you. Erik

Upvotes: 0

Views: 2905

Answers (1)

Rubens Mariuzzo
Rubens Mariuzzo

Reputation: 29241

Less.js is a CSS pre-processor, it means that you will be able to write your in style using the Less pre-processor languages in a *.less file, then Less.js will compile it into pure CSS.

CSS pre-processor comes with a lot of powerful features such as: variables, mixins, nested rules, operations, imports and a lot more.

With Less.js you have two options:

  1. Running Less at client-side: write your styles in Less then include the JavaScript pre-processor: Less.js.
  2. Running Less at server-side: write your styles in Less then run the pre-processor using Node.js or Rhino, and in other cases you may use some ports like DotLess.

If you have potentially large Web Interface Design (complex layout, sprites, multiple navigation, several forms, etc...) then you should consider using one of the popular CSS pre-processor like Less.js or Sass. They will help you a lot.

Keep in mind... there are big project build on top of CSS pre-processor, Twitter Bootsrap use Less and Compass is a great framework that will kill your aches related to cross-browser issues concerning inline-blocks, clearfix, box-shadow, etc...

Upvotes: 8

Related Questions