What is LESS and why use it?

LESS is a cascading style sheet preprocessor; we can think of it as a server-side script for CSS files, enabling us to do a number of things that CSS doesn't support (yet), just like PHP and/or ASP can do for an HTML page. The following diagram should help us better understand the concept:

These are the main advantages of using a hypertext preprocessor instead of writing raw HTML pages; we're talking about PHP, but the same goes for ASP.NET Web Forms, Razor, and basically everything else.

The following are the advantages of using LESS instead of writing raw CSS files:

As we can see, they serve the exact same purpose ...

Get ASP.NET Core 2 and Angular 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.