36 releases

Uses old Rust 2015

0.4.22 Jun 1, 2021
0.4.21 May 21, 2020
0.4.19 Apr 5, 2020
0.4.18 Feb 11, 2020
0.0.8 Mar 28, 2015

#23 in #sass

Download history 192/week @ 2024-03-13 223/week @ 2024-03-20 417/week @ 2024-03-27 494/week @ 2024-04-03 242/week @ 2024-04-10 152/week @ 2024-04-17 197/week @ 2024-04-24 192/week @ 2024-05-01 105/week @ 2024-05-08 178/week @ 2024-05-15 211/week @ 2024-05-22 228/week @ 2024-05-29 145/week @ 2024-06-05 201/week @ 2024-06-12 209/week @ 2024-06-19 277/week @ 2024-06-26

863 downloads per month
Used in 13 crates (2 directly)

MIT license

1MB
24K SLoC

C++ 23K SLoC // 0.1% comments Rust 1K SLoC // 0.0% comments Visual Studio Project 194 SLoC M4 112 SLoC // 0.3% comments C 107 SLoC // 0.2% comments Automake 106 SLoC // 0.0% comments Bitbake 66 SLoC // 0.1% comments Perl 56 SLoC // 0.4% comments RPM Specfile 43 SLoC Visual Studio Solution 39 SLoC Shell 10 SLoC

Contains (obscure autoconf code, 5KB) libsass/configure.ac

sass-rs

Build Status Windows build status

Api documentation on docs.rs

This crate is a wrapper around libsass, currently tracking v3.6.4.

To build this crate on Windows, you will need to have Visual Studio installed.

You can control the number of CPU used to build libsass by setting the MAKE_LIBSASS_JOBS variable to the desired value. It defaults to the number of CPUs in the machine.

Binary

This package also provides a small binary that can be cargo installed to convert Sass files and print the output CSS. Example usage:

$ sass-rs < source/style.scss  # for SCSS
$ sass-rs --sass < source/style.sass  # for SASS
$ sass-rs --sass --expanded < source/style.sass
$ sass-rs --sass --compact < source/style.sass
$ sass-rs --sass --compressed < source/style.sass
$ sass-rs --sass --compressed < source/style.sass > build/style.css

This is a small added feature that isn't meant to fulfill every usecases. If you want to have something added to the binary, do a PR as I will not implement it myself.

Not supported yet

Importers and functions are not supported yet.

Building (Windows)

Windows compilation using VS 2019 requires that all the environment variables for MSBuild to be availble.

An indicator that the environment is not properly setup is the following error message:

error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

If you find this error, you have a couple of of options to select:

  • [Easiest] Open the Developer Command Prompt for VS 2019 application to compile the project. This terminal will setup all the needed environment variables to let it compile.
  • Setup the environment variables (eg: PATH, LIB) as documented on Microsoft's website
  • Install the complete setup of Visual Studio 2015 - not only the Visual C++ Build tools

Dependencies