Skip to content
This repository

A C/C++ implementation of a Sass compiler

Merge pull request #329 from nzbart/windows_cwd_fix

Convert Windows backslashes into forward slashes on Windows when retrieving cwd
latest commit a561f1257e
Aaron Leung akhleung authored
Octocat-spinner-32 m4 Use autoreconf -i and add gitkeep to m4 to make automake happy
Octocat-spinner-32 script Move Travis script to script/cibuild
Octocat-spinner-32 support Add pkgconfig support
Octocat-spinner-32 test Move test harnesses under test
Octocat-spinner-32 .editorconfig Fix EditorConfig Makefile selector
Octocat-spinner-32 .gitattributes Add gitattributes for line ending normalization
Octocat-spinner-32 .gitignore Merge pull request #258 from nschonni/bootstrap-script
Octocat-spinner-32 .travis.yml Move Travis script to script/cibuild
Octocat-spinner-32 COPYING Add autotools config
Octocat-spinner-32 INSTALL Add autotools config
Octocat-spinner-32 LICENSE Move read me and license out of the source
Octocat-spinner-32 Makefile Split sources to multiple lines
Octocat-spinner-32 Makefile.am Merge pull request #270 from nschonni/remove-cli-harness
Octocat-spinner-32 Readme.md Update instructions for running the tests
Octocat-spinner-32 ast.cpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 ast.hpp getting attribute selectors with interpolated strings to work
Octocat-spinner-32 ast_def_macros.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 ast_factory.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 ast_fwd_decl.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 backtrace.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 base64vlq.cpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 base64vlq.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 bind.cpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 bind.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 color_names.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 configure.ac Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 constants.cpp working on url parsing
Octocat-spinner-32 constants.hpp working on url parsing
Octocat-spinner-32 context.cpp Only replace backslashes with forwards slashes on Windows because bac…
Octocat-spinner-32 context.hpp making the precision configurable
Octocat-spinner-32 contextualize.cpp getting attribute selectors with interpolated strings to work
Octocat-spinner-32 contextualize.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 copy_c_str.cpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 copy_c_str.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 emscripten_wrapper.cpp fixing bad file name empscripten_wrapper.hpp
Octocat-spinner-32 emscripten_wrapper.hpp fixing bad file name empscripten_wrapper.hpp
Octocat-spinner-32 environment.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 error_handling.cpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 error_handling.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 eval.cpp making the precision configurable
Octocat-spinner-32 eval.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 expand.cpp Allowing at-rules to have expressions instead of just selectors. Prob…
Octocat-spinner-32 expand.hpp fixing a bug/regression whereby placeholder selectors are output when…
Octocat-spinner-32 extconf.rb Restructuring the library to work as a more
Octocat-spinner-32 extend.cpp fixing some edge cases and regressions with the recent @extend updates
Octocat-spinner-32 extend.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 file.cpp nuther tweak to the Windows path handling
Octocat-spinner-32 file.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 functions.cpp If the argument is a list, use its separator in function `append`.
Octocat-spinner-32 functions.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 inspect.cpp making the precision configurable
Octocat-spinner-32 inspect.hpp sourcemaps: Fix line number calculation.
Octocat-spinner-32 kwd_arg_macros.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 mapping.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 memory_manager.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 operation.hpp normalize the spacing
Octocat-spinner-32 output_compressed.cpp Getting CSS imports to output in the correct places. Addresses #289.
Octocat-spinner-32 output_compressed.hpp Getting CSS imports to output in the correct places. Addresses #289.
Octocat-spinner-32 output_nested.cpp Getting CSS imports to output in the correct places. Addresses #289.
Octocat-spinner-32 output_nested.hpp Getting CSS imports to output in the correct places. Addresses #289.
Octocat-spinner-32 parser.cpp Getting CSS imports to output in the correct places. Addresses #289.
Octocat-spinner-32 parser.hpp nuther edge case with slashy urls
Octocat-spinner-32 paths.hpp Re-apply indenting fixes
Octocat-spinner-32 position.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 prelexer.cpp changing this variable name to lowercase
Octocat-spinner-32 prelexer.hpp nuther edge case with slashy urls
Octocat-spinner-32 sass.cpp making the precision configurable
Octocat-spinner-32 sass.h making the precision configurable
Octocat-spinner-32 sass_interface.cpp making the precision configurable
Octocat-spinner-32 sass_interface.h making the precision configurable
Octocat-spinner-32 source_map.cpp sourcemaps: Fix line number calculation.
Octocat-spinner-32 source_map.hpp sourcemaps: Fix line number calculation.
Octocat-spinner-32 subset_map.hpp Re-apply indenting fixes
Octocat-spinner-32 test-driver Use automake's test driver.
Octocat-spinner-32 to_c.cpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 to_c.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 to_string.cpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 to_string.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 token.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 trim.cpp commenting out this unfinished stuff
Octocat-spinner-32 trim.hpp commenting out this unfinished stuff
Octocat-spinner-32 units.cpp Revert "Merge pull request #236 from nschonni/move-to-src"
Octocat-spinner-32 units.hpp Revert "Merge pull request #236 from nschonni/move-to-src"
Readme.md

Libsass

by Aaron Leung (@akhleung) and Hampton Catlin (@hcatlin)

Build Status

http://github.com/hcatlin/libsass

Libsass is just a library, but if you want to RUN libsass, then go to http://github.com/hcatlin/sassc or http://github.com/hcatlin/sassruby or find your local implementer.

About

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.

Developing

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 uses a git submodule to include libsass. When developing libsass, its best to actually check out SassC and develop in that directory with the SassC spec and tests there.

We even run Travis tests for SassC!

Tests

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.

Usage

While libsass is primarily implemented in C++, it provides a simple C interface that is defined in sass_interface.h. Its usage is pretty straight forward.

First, you create a sass context struct. We use these objects to define different execution parameters for the library. There are three different context types.

sass_context();        // string-in-string-out compilation
sass_file_context();   // file-based compilation
sass_folder_context(); // full-folder multi-file

Each of the contexts have slightly different behavior and are implemented seperately. This does add extra work to implementing a wrapper library, but we felt that a mixed-use context object provides for too much implicit logic. What if you set "input_string" AND "input_file"... what do we do? This would introduce bugs into wrapper libraries that would be difficult to debug.

We anticipate that most adapters in most languages will define their own logic for how to separate these use cases based on the language. For instance, the original Ruby interface has a combined interface, but is backed by three different processes.

To generate a context, use one of the following methods.

sass_new_context();
sass_new_file_context();
sass_new_folder_context();

Again, please see the sass_interface.h for more information.

And, to get even more information, then please see the implementations in SassC and SassC-Ruby.

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 created by the co-creator of this library, Hampton Catlin (@hcatlin). The extension and continuing evolution of the language has all been the result of years of work by Nathan Weizenbaum (@nex3) and Chris Eppstein (@chriseppstein).

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

Contribution Agreement

Any contribution to the project are seen as copyright assigned to Hampton Catlin, a human on the planet earth. Your contribution warrants that you have the right to assign copyright on your work. The intention here is to ensure that the project remains totally free (liberal, like).

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

Something went wrong with that request. Please try again.