2014-07-11 04:28:14 +02:00
|
|
|
|
---
|
2016-02-27 13:58:18 +01:00
|
|
|
|
title: LibSass
|
2018-10-24 00:06:39 +02:00
|
|
|
|
introduction: >
|
2021-05-26 21:18:50 +02:00
|
|
|
|
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.
|
2018-10-24 00:06:39 +02:00
|
|
|
|
---
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
|
|
|
|
:markdown
|
2014-10-04 00:17:39 +02:00
|
|
|
|
## Wrappers
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
2016-09-17 12:11:34 +02:00
|
|
|
|
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
|
2018-10-24 00:06:39 +02:00
|
|
|
|
other wrappers for LibSass. We encourage you to write your own wrapper --- the
|
2018-03-09 23:43:20 +01:00
|
|
|
|
whole point of LibSass is that we want to bring Sass to many other languages,
|
2016-09-17 12:11:34 +02:00
|
|
|
|
not just Ruby!
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
2016-09-17 12:11:34 +02:00
|
|
|
|
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.
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
2014-10-04 00:17:39 +02:00
|
|
|
|
%ul.slides
|
|
|
|
|
%li#sassc
|
|
|
|
|
:markdown
|
2015-06-06 00:11:10 +02:00
|
|
|
|
### Sass C
|
|
|
|
|
|
2018-03-09 23:43:20 +01:00
|
|
|
|
[SassC](https://github.com/sass/sassc) (get it?) is a wrapper written in
|
2016-09-17 12:11:34 +02:00
|
|
|
|
C.
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
2016-09-17 12:11:34 +02:00
|
|
|
|
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:
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
2018-10-24 00:06:39 +02:00
|
|
|
|
= partial 'code-snippets/libsass-setup'
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
2018-10-24 00:06:39 +02:00
|
|
|
|
:markdown
|
2019-10-10 23:10:58 +02:00
|
|
|
|
The executable will be in the bin folder. To run it, try something
|
2016-09-17 12:11:34 +02:00
|
|
|
|
like:
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
2018-10-24 00:06:39 +02:00
|
|
|
|
= partial 'code-snippets/libsass-execute'
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
2018-03-09 23:43:20 +01:00
|
|
|
|
%li#crystal
|
|
|
|
|
:markdown
|
|
|
|
|
### Crystal
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
|
|
|
|
[sass.cr](https://github.com/straight-shoota/sass.cr) is a LibSass wrapper
|
|
|
|
|
for the [Crystal programming language](https://crystal-lang.org/).
|
2018-03-09 23:43:20 +01:00
|
|
|
|
|
2014-10-04 00:17:39 +02:00
|
|
|
|
%li#go
|
|
|
|
|
:markdown
|
|
|
|
|
### Go
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
2016-01-20 16:36:36 +01:00
|
|
|
|
[go-libsass](https://github.com/wellington/go-libsass) has the most active
|
2018-10-24 00:06:39 +02:00
|
|
|
|
GoLang wrapper. [gosass](https://github.com/moovweb/gosass) is another
|
|
|
|
|
LibSass wrapper.
|
2015-06-06 00:11:10 +02:00
|
|
|
|
|
2018-10-24 00:06:39 +02:00
|
|
|
|
[C6](https://github.com/c9s/c6) is a Sass 3.2 compatible implementation
|
|
|
|
|
written in pure GoLang that aims to extend Sass.
|
2016-01-20 16:36:36 +01:00
|
|
|
|
[wellington/sass](https://github.com/wellington/sass) is an in-progress
|
2018-10-24 00:06:39 +02:00
|
|
|
|
pure Go Sass lexer, parser, and compiler.
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
|
|
|
|
%li#java
|
|
|
|
|
:markdown
|
|
|
|
|
### Java
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
|
|
|
|
There is one Java wrapper --- [jsass](https://github.com/bit3/jsass).
|
|
|
|
|
There is also a plugin for Maven --- [LibSass Maven
|
2019-11-18 22:52:05 +01:00
|
|
|
|
plugin](https://gitlab.com/haynes/libsass-maven-plugin).
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
|
|
|
|
%li#javascript
|
|
|
|
|
:markdown
|
|
|
|
|
### JavaScript
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
2018-03-17 00:20:00 +01:00
|
|
|
|
The [sass.js](https://github.com/medialize/sass.js) project makes
|
|
|
|
|
LibSass available as pure JavaScript. There's a way to [test it in the
|
|
|
|
|
browser](http://medialize.github.io/playground.sass.js/), too.
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
|
|
|
|
%li#lua
|
|
|
|
|
:markdown
|
|
|
|
|
### Lua
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
2018-03-09 23:43:20 +01:00
|
|
|
|
The Lua wrapper is found at
|
2016-09-17 12:11:34 +02:00
|
|
|
|
[lua-sass](https://github.com/craigbarnes/lua-sass).
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
|
|
|
|
%li#net
|
|
|
|
|
:markdown
|
|
|
|
|
### .NET
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
2019-05-21 22:40:29 +02:00
|
|
|
|
[LibSass Host](https://github.com/Taritsyn/LibSassHost) is updated
|
2016-09-17 12:11:34 +02:00
|
|
|
|
regularly, and is probably the best bet. There's also
|
2019-05-21 22:40:29 +02:00
|
|
|
|
[libsass-net](https://github.com/darrenkopp/libsass-net) or [NSass](https://github.com/TBAPI-0KA/NSass),
|
|
|
|
|
although they haven't been updated in a while.
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
|
|
|
|
%li#node
|
|
|
|
|
:markdown
|
|
|
|
|
### Node
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
2016-09-17 12:11:34 +02:00
|
|
|
|
The [node-sass](https://github.com/sass/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](https://www.npmjs.org/package/node-sass), and
|
|
|
|
|
[there's a dedicated twitter account](https://twitter.com/nodesass) for
|
|
|
|
|
updates.
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
|
|
|
|
%li#perl
|
|
|
|
|
:markdown
|
|
|
|
|
### Perl
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
2016-09-17 12:11:34 +02:00
|
|
|
|
The [CSS::Sass](https://github.com/sass/perl-libsass) project is updated
|
|
|
|
|
regularly. There's the
|
|
|
|
|
[Text-Sass-XS](https://github.com/ysasaki/Text-Sass-XS) project, too,
|
|
|
|
|
although it hasn't been updated in a while.
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
|
|
|
|
%li#php
|
|
|
|
|
:markdown
|
|
|
|
|
### PHP
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
2020-04-15 01:20:14 +02:00
|
|
|
|
The [SassPHP](https://github.com/absalomedia/sassphp) project is an
|
2018-10-24 00:06:39 +02:00
|
|
|
|
updated fork of an [older PHP
|
|
|
|
|
version](https://github.com/jamierumbelow/sassphp).
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
|
|
|
|
%li#python
|
|
|
|
|
:markdown
|
|
|
|
|
### Python
|
2019-02-26 02:05:24 +01:00
|
|
|
|
The [libsass-python](https://github.com/sass/libsass-python) project
|
|
|
|
|
is updated regularly. There are more details on
|
|
|
|
|
[its own website](https://sass.github.io/libsass-python/).
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
2019-02-26 02:05:24 +01:00
|
|
|
|
Three other Python projects,
|
|
|
|
|
[python-scss](https://github.com/pistolero/python-scss),
|
2016-09-17 12:11:34 +02:00
|
|
|
|
[pylibsass](https://github.com/rsenk330/pylibsass) and
|
|
|
|
|
[SassPython](https://github.com/marianoguerra/SassPython), haven't been
|
|
|
|
|
updated in a while.
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%li#ruby
|
|
|
|
|
:markdown
|
|
|
|
|
### Ruby
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
2018-03-09 23:43:20 +01:00
|
|
|
|
LibSass has also been ported back into Ruby for the
|
2016-09-17 12:11:34 +02:00
|
|
|
|
[sassc-ruby](https://github.com/sass/sassc-ruby) project.
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
2022-03-26 00:25:28 +01:00
|
|
|
|
%li#r
|
|
|
|
|
:markdown
|
|
|
|
|
### R
|
|
|
|
|
|
|
|
|
|
The [R](https://www.r-project.org/) [Sass package](https://github.com/rstudio/sass)
|
|
|
|
|
wraps LibSass with additional caching and bundling methods.
|
|
|
|
|
[Extended documentation](https://rstudio.github.io/sass/).
|
|
|
|
|
|
2018-03-19 17:11:16 +01:00
|
|
|
|
%li#rust
|
|
|
|
|
:markdown
|
|
|
|
|
### Rust
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
|
|
|
|
The [`sass_rs`](https://github.com/compass-rs/sass-rs) crate is a LibSass
|
|
|
|
|
wrapper and is updated regularly.
|
2018-03-19 17:11:16 +01:00
|
|
|
|
|
2014-10-04 00:17:39 +02:00
|
|
|
|
%li#scala
|
|
|
|
|
:markdown
|
|
|
|
|
### Scala
|
2018-10-24 00:06:39 +02:00
|
|
|
|
|
2018-03-09 23:43:20 +01:00
|
|
|
|
The only Scala project, [Sass-Scala](https://github.com/kkung/Sass-Scala),
|
2016-09-17 12:11:34 +02:00
|
|
|
|
hasn't been updated in a couple of years.
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
2016-02-27 13:58:18 +01:00
|
|
|
|
%h2 About LibSass
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
|
|
|
|
:markdown
|
2018-10-24 00:06:39 +02:00
|
|
|
|
This project is the brainchild of [Hampton
|
|
|
|
|
Catlin](http://twitter.com/hcatlin), the original creator of Sass, and is
|
|
|
|
|
sponsored by [Moovweb](http://moovweb.com/). [Aaron
|
|
|
|
|
Leung](http://github.com/akhleung) from Moovweb is the primary developer.
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
|
|
|
|
%figure
|
2018-10-24 00:06:39 +02:00
|
|
|
|
= image_tag 'logos/libsass.png', alt: 'LibSass logo'
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
2018-10-24 00:06:39 +02:00
|
|
|
|
- content_for :navigation do
|
2019-12-13 04:26:12 +01:00
|
|
|
|
%h2 Wrappers
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
2018-12-28 01:31:28 +01:00
|
|
|
|
.sl-c-list-navigation-wrapper
|
|
|
|
|
:markdown
|
|
|
|
|
- [SassC](#sassc)
|
|
|
|
|
- [Crystal](#crystal)
|
|
|
|
|
- [Go](#go)
|
|
|
|
|
- [Java](#java)
|
|
|
|
|
- [JavaScript](#javascript)
|
|
|
|
|
- [Lua](#lua)
|
|
|
|
|
- [.NET](#net)
|
|
|
|
|
- [Node](#node)
|
|
|
|
|
- [Perl](#perl)
|
|
|
|
|
- [PHP](#php)
|
|
|
|
|
- [Python](#python)
|
2022-03-26 00:25:28 +01:00
|
|
|
|
- [R](#r)
|
2018-12-28 01:31:28 +01:00
|
|
|
|
- [Ruby](#ruby)
|
|
|
|
|
- [Scala](#scala)
|
2014-10-04 00:17:39 +02:00
|
|
|
|
|
2018-10-24 00:06:39 +02:00
|
|
|
|
- content_for :complementary do
|
2019-12-13 04:26:12 +01:00
|
|
|
|
%h2 Resources
|
2014-07-11 04:28:14 +02:00
|
|
|
|
|
|
|
|
|
%ul
|
|
|
|
|
- for project in data.libsass.resources
|
|
|
|
|
%li
|
|
|
|
|
= link_to project.name, project.url
|
|
|
|
|
—
|
|
|
|
|
= project.description
|