Project Description

The .Net wrapper of the libsass library that is C++ port of the Sass CSS precompiler.

Updates

About

Libsass

Libsass is a C/C++ port of the Sass CSS precompiler. The original version was written in Ruby, but this version is meant for efficiency and portability.

This library strives to be light, simple, and easy to build and integrate with a variety of platforms and languages.

/source/

LibSass.Net

Just a wrapper of the libsass with several improvements.
It supports custom importers (ISourceProvider) instead of libsass.

Installations:

To install full support of Sass to an ASP.NET web application:

PM> Install-Package XWeb.Web.Sass.Full -Pre

Http handler

By default, it serves *.scss files. Handler specified in Web.config file.

Bundle

To create Sass bundle, write those in bundle registration:

using namespace XWeb.Web.Optimization.Sass;
public static void RegisterBundles(BundleCollection bundles)
{
  ...
  bundles.Add(
    new SassBundle("~/Content/Styles/sass")
      .Include(
        "~/Content/Styles/sass/base.scss",
        "~/Content/Styles/sass/extended.scss",
        "..."));
}

To use bundle in razor view:

@Styles.Render("~/Content/Styles/sass")


Note: If BundleTable.EnableOptimizations is false (usually on Debug config), bundle will not be packed and would not be transformed. In this case, must be handler (SassHttpHandler) specified to serve *.scss files.

Documentation

Coming soon =)

Roadmap

It is plan to build NuGet packages:

Links

Last edited Dec 8, 2012 at 3:26 PM by Igorbek, version 14