A C/C++ implementation of a Sass compiler
C++ C Shell Other
Latest commit 5b92405 Dec 6, 2016 @mgreter mgreter committed on GitHub Merge pull request #2238 from mgreter/bugfix/issue-2236
Fix modulo operation to behave as ruby sass
Failed to load latest commit information.
.github Tiny typo fixup Oct 6, 2016
contrib Change C-API to pass compiler to custom functions Oct 22, 2015
docs Implement source_map_file_urls option Oct 22, 2016
include Implement source_map_file_urls option Oct 22, 2016
m4 Reorganize source files into sub-directories Jul 19, 2015
res Fix build for mingw and dll linking Dec 21, 2014
script Don't probe tests in CI Oct 18, 2016
src Fix modulo operation to behave as ruby sass Dec 6, 2016
test Remove `To_String` by using `AST->to_string` and `inspect` Jan 17, 2016
win Error when declarations are printed without ruleset May 2, 2016
.editorconfig Update .editorconfig Jan 4, 2016
.gitattributes Add gitattributes for line ending normalization Jan 13, 2014
.gitignore Refactor directive (i.e. At_Rule) parsing Apr 23, 2016
.travis.yml Only generate coverage once Apr 14, 2016
COPYING Add autotools config Jun 14, 2012
GNUmakefile.am Enable probing for passing todo specs in CI Apr 23, 2016
INSTALL we dont follow those install rules Oct 4, 2014
LICENSE Changing copyright to Sass Open Source Foundation Feb 1, 2016
Makefile Remove -ldl flag from OpenBSD too Oct 19, 2016
Makefile.conf Change sort order for source files (sort by compile time) Oct 22, 2016
Readme.md Merge pull request #2176 from delapuente/debug-builds Sep 12, 2016
SECURITY.md Let people know how to report security bugs Jun 9, 2015
appveyor.yml Merge pull request #2035 from mgreter/feature/probe-passing-todo Apr 23, 2016
configure.ac Fix automake compile on msys2 and mingw64 May 1, 2016
extconf.rb Restructuring the library to work as a more Apr 22, 2012
version.sh Remove hard-coded version from autotools build Feb 24, 2015



by Aaron Leung (@akhleung), Hampton Catlin (@hcatlin), Marcel Greter (@mgreter) and Michael Mifsud (@xzyfer)

Unix CI Windows CI Bountysource Coverage Status Join us


LibSass is just a library, but if you want to RUN LibSass, then go to https://github.com/sass/sassc or https://github.com/sass/sassc-ruby or find your local implementer.

LibSass requires GCC 4.6+ or Clang/LLVM. If your OS is older, this version may not compile.

On Windows, you need MinGW with GCC 4.6+ or VS 2013 Update 4+. It is also possible to build LibSass with Clang/LLVM on Windows.


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.


As you may have noticed, the LibSass repo itself has no executables and no tests. Oh noes! How can you develop???

Well, luckily, SassC is the official binary wrapper for LibSass and is always kept in sync. SassC is used by continous integration systems in LibSass repository. When developing LibSass, it is best to actually checkout SassC and develop in that directory with the SassC spec and tests there.

We even run Travis tests for SassC!


Since LibSass is a pure library, tests are run through the SassSpec project using the SassC driver.

To run tests against LibSass while developing, you can run ./script/spec. This will clone SassC and Sass-Spec under the project folder and then run the Sass-Spec test suite. You may want to update the clones to ensure you have the latest version.

DEBUG builds

Set the environment variable DEBUG to 1 to enable debug builds that can be debugged with gdb, lldb and others. E.g.: use $ DEBUG=1 ./script/spec to run the tests with a debug build.

Library Usage

While LibSass is a library primarily written in C++, it provides a simple C interface which should be used by most implementers. LibSass does not do much on its own without an implementer. This can be a command line tool, like sassc or a binding to your favorite programing language.

If you want to build or interface with LibSass, we recommend to check out the documentation pages about building LibSass and the C-API documentation.

About Sass

Sass is a CSS pre-processor language to add on exciting, new, awesome features to CSS. Sass was the first language of its kind and by far the most mature and up to date codebase.

Sass was originally concieved of by the co-creator of this library, Hampton Catlin (@hcatlin). Most of the language has been the result of years of work by Natalie Weizenbaum (@nex3) and Chris Eppstein (@chriseppstein).

For more information about Sass itself, please visit http://sass-lang.com

Initial development of libsass by Aaron Leung and Hampton Catlin was supported by Moovweb.


Our MIT license is designed to be as simple, and liberal as possible.

sass2scss was originally written by Marcel Greter and he happily agreed to have it merged into the project.