Installing the dotLess plugin for Assman:

The Assman.dotLess NuGet package adds support for .less files within Assman. After installing this package, you will be able to include .less files and consolidate them just like you can .css files.

1. Install the Assman.dotLess NuGet package:
Install-Package Assman.dotLess
2. If you are running .NET 3.5, add the following line of code to your routing setup (e.g. in your Global.aspx.cs file):
routes.IgnoreLessRoutes();
Note that the IgnoreLessRoutes extension method requires you to add a "using Assman.dotLess" at the top of the file. This will ensure that routing does not interfere with requests for .less files.

3. From a View, Layout, or Partial, you can now start including .less files using the RequireStylesheet helper. If you are using Razor, it might look something like this:
@Html.RequireStylesheet("~/path/to/my/less_stylesheet.less")
4. Less files will also automatically be consolidated into the groups using the conventions you configured on the Assman.config file. If you want to manually add a .less file to a group, you can also do that.

Last edited Jul 4, 2011 at 9:08 PM by andyalm, version 1

Comments

No comments yet.