layout | title | introduction | navigation | complementary_content |
---|---|---|---|---|
has_both_sidebars |
LibSass |
LibSass is an implementation of Sass in C/C++, designed to be easy to integrate into many different languages. However, as time wore on it ended up lagging behind [Dart Sass](/dart-sass) in features and CSS compatibility. **LibSass is now deprecated**—new projects should use Dart Sass instead.
|
<h2>Wrappers</h2>
<nav class="sl-c-list-navigation-wrapper">
- [SassC](#sassc)
- [Crystal](#crystal)
- [Go](#go)
- [Java](#java)
- [JavaScript](#javascript)
- [Lua](#lua)
- [.NET](#net)
- [Node](#node)
- [Perl](#perl)
- [PHP](#php)
- [Python](#python)
- [Ruby](#ruby)
- [R](#r)
- [Rust](#rust)
- [Scala](#scala)
</nav>
|
<h2>Resources</h2>
- [Lightning fast Sass compiling with libsass, Node-sass and
Grunt-sass](https://benfrain.com/lightning-fast-sass-compiling-with-libsass-node-sass-and-grunt-sass/)
--- by Ben Frain, August 2013
|
LibSass is just a library. To run the code locally (i.e. to compile your stylesheets), you need an implementer, or "wrapper". There are a number of other wrappers for LibSass. We encourage you to write your own wrapper --- the whole point of LibSass is that we want to bring Sass to many other languages, not just Ruby!
Below are the LibSass wrappers that we're currently aware of. Sometimes there are multiple wrappers per language -- in those cases, we put the most recently-updated wrapper first.
{% headsUp %} Because LibSass is deprecated, most of these wrappers are end-of-life. In order to use them with the latest maintenance releases of LibSass, you may need to build them by hand. {% endheadsUp %}
-
SassC (get it?) is a wrapper written in C.
To run the compiler on your local machine, you need to build SassC. To build SassC, you must have either a local copy of the LibSass source or it must be installed into your system. For development, please use the source version. You must then setup an environment variable pointing to the LibSass folder, for example:
export SASS_LIBSASS_PATH=/Users/hampton/path/libsass
The executable will be in the bin folder. To run it, try something like:
./bin/sassc [input file] > output.css
-
sass.cr is a LibSass wrapper for the Crystal programming language.
-
go-libsass has the most active GoLang wrapper. gosass is another LibSass wrapper.
C6 is a Sass 3.2 compatible implementation written in pure GoLang that aims to extend Sass. wellington/sass is an in-progress pure Go Sass lexer, parser, and compiler.
-
There is one Java wrapper --- jsass. There is also a plugin for Maven --- LibSass Maven plugin.
-
The sass.js project makes LibSass available as pure JavaScript. There's a way to test it in the browser, too.
-
The Lua wrapper is found at lua-sass.
-
LibSass Host is updated regularly, and is probably the best bet. There's also libsass-net or NSass, although they haven't been updated in a while.
-
The node-sass project has proven to be popular, and we've taken it into the main Sass GitHub repo. Check out its package page here, and there's a dedicated twitter account for updates.
-
The CSS::Sass project is updated regularly. There's the Text-Sass-XS project, too, although it hasn't been updated in a while.
-
The SassPHP project is an updated fork of an older PHP version.
-
The libsass-python project is updated regularly. There are more details on its own website.
Three other Python projects, python-scss, pylibsass and SassPython, haven't been updated in a while.
-
LibSass has also been ported back into Ruby for the sassc-ruby project.
-
The R Sass package wraps LibSass with additional caching and bundling methods. Extended documentation.
-
The
sass_rs
crate is a LibSass wrapper and is updated regularly. -
The only Scala project, Sass-Scala, hasn't been updated in a couple of years.
This project is the brainchild of Hampton Lintorn-Catlin, the original creator of Sass. Aaron Leung is the primary developer.