Reputation:
Just wondering what are the advantages of compiling .less in to .css with compilers such as Crunch or Prepros rather than including the .less file directly? Does .less rely on less.js library and the .css could be a standalone? I am using it for Twitter Bootstrap 3.
Upvotes: 0
Views: 94
Reputation: 1792
The main advantage is that the site is available and ready for browsers that have javascript disabled or have no support for it.
There are also server-side pre-request compilers that take the manual compilation step out of the process but don't depend on javascript in the browser. This makes for a best-of-both-worlds solution.
One such example is the Rails asset-pipeline. All of the benefits, none of the weaknesses. :)
Upvotes: 2
Reputation: 3938
Indeed a .less file would require the less.js library. I would be surprised if there are any browsers who understand .less natively. So the advantage of compiling it to CSS is clear: less overhead (no less.js dependency) and faster parsing.
Upvotes: 0