Thursday, May 22, 2014

Starting with LESS in .NET environment.

Researching the topic above I did not find anything useful for my project. Therefore my team lead and I found out pretty good way to implement LESS in out Bootstrap-Knockout environment.

1. Download less-1.7.0.min.js from LESS site and add to your scripts folder.

2. Open HTML file and add the line.
<script src="Scripts/less-1.7.0.min.js"></script>

3. Using Visual studio, create .less file and add line to HTML file before js-files.
<link rel="stylesheet/less" type="text/css" href="Content/custom/css/hello1.less">

4. Open web.config file and after(underneath) <system.web> add
<system.webServer>
    <staticContent>
      <mimeMap fileExtension=".less" mimeType="text/css" />
    </staticContent>
  </system.webServer>

Now you can play with .less files in .NET environment.

No comments:

Post a Comment