Using LESS on a .Net project
I was checking which CSS pre-processor to use on a .Net project and looks like LESS is the best option as it doesn't require Ruby like SASS does. So here we go: 1. Install it using the NuGet package. Install dotLess, which is the one prepared for .Net projects, not the less.js one. Also install System.Web.Optimization.Less which we'll need later. 2. Create a .less file at your Content root just as an example: default.less with this code: [sourcecode language="css" wraplines="false"] @color: #0808b9; //blue @errorColor: red; h2 { color: @color; } p { color: @color; } p.error { color: @errorColor; } [/sourcecode] 3. Now add a controller/action/view with this on the view: [sourcecode language="html" wraplines="false"] <h2>Index</h2> <p class="error">This paragraph should be red!</p> <p>This should be blue!</p> [/sourcecode] 4. That was just…