Configuring LESS

LESS happens to be written in JavaScript, so installing it can be as easy as downloading its JavaScript library (less.js), linking it to our index.html page, and letting its magic work without having to set up anything else.

Should we do that, then? Not a chance. As we said earlier, delegating the compilation task on the client side would be highly inefficient, especially in a client-intensive Angular 2-based native web app. This is what we're going to do instead:

  • Add a new style.less file to our project.
  • Update our Gulp script to process and compile it, outputting the resulting style.css file into the /wwwroot/ folder.
  • Link the resulting .css file to the /wwwroot/index.html root application file.
  • Make a quick test before starting ...

Get ASP.NET Core: Cloud-ready, Enterprise Web Application Development 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.