An alternative LESS compiler with no setup. Uses the official node.js based LESS compiler under the hood with AutoPrefixer and CSSComb built in.
See the change log for changes and road map.
All .less files will automatically be compiled into a .css file nested under it in Solution Explorer after being enabled on the project.
By default, compilation is off and that's indicated by a watermark at the bottom right corner of any LESS file.
To enable LESS compilation, simply click the watermark and it changes to indicate LESS compilation is "on".
For files that are being ignored, the watermark looks like this:
You can stil reference these files from your own
Saving the LESS file will then compile into CSS.
The automatic compilation doesn't happen if:
The Output Window shows details about what is being executed to make it easy to troubleshoot any issues.
Note that the the solution (.sln) file is updated to reflect that LESS compilation is enabled. Remember to save the solution when prompted to persits the information.
The solution node in Solution Explorer has a command to compile all
You can set any compiler options as defined on the LESS compiler website inside a comment in the
// lessc --strict-math=on
The default less compiler arguments are:
lessc --relative-urls --autoprefix="> 0%" "<file.css>"
Here are some examples of the code comments to use in the
// lessc --source-map
This will produce a
// lessc "../wwwroot/css/file.css"
// lessc --autoprefix="last 2 versions, > 5%"
See Browserlist for description on how to construct the value.
// lessc --csscomb=zen
Available values are
By default a
// no-minify lessc --relative-urls"
// no-minify lessc --relative-urls --source-map "../wwwroot/css.file.css"
This example doesn't minify the output, enables both relative urls and source maps and redirects the output file to a different directory.
You can specify the compiler options for the solution, the project or for individual folders by placing a file called
The default file cannot contain information about the output file, but all other options can be set.
Note that it isn't prefixed with
Even though minification isn't technically an option you set on the compiler, you can still opt out of minification like so:
Check out the contribution guidelines if you want to contribute to this project.
For cloning and building this project yourself, make sure to install the Extensibility Tools 2015 extension for Visual Studio which enables some features used by this project.