#sass

sass-alt

A more powerful alternative to sass-rs that provides SASS functions, SASS importers and source map manipulation

8 releases

0.2.7 Dec 18, 2017
0.2.6 Dec 15, 2017

#81 in Build Utils

Download history 1/week @ 2019-02-06 1/week @ 2019-02-13 9/week @ 2019-02-20 17/week @ 2019-02-27 2/week @ 2019-03-06 51/week @ 2019-03-20 17/week @ 2019-03-27 9/week @ 2019-04-03 3/week @ 2019-04-10 4/week @ 2019-04-17 10/week @ 2019-04-24 1/week @ 2019-05-01 8/week @ 2019-05-08 19/week @ 2019-05-15

59 downloads per month

MIT license

106KB
2.5K SLoC

sass-alt

sass-alt is a rust crate that provides altenative bindings to sass-rs for using libsass (specifically, the sass-sys bindings).

It exposes functionality to register SASS functions, SASS importers, SASS headers and to manipulate source maps.

Licensing

The license for this project is MIT.


lib.rs:

This crate provides a simple API that allows one to compile SASS and use Rust functions as SASS functions, importers and headers. It is used by the Cordial crate to allow Lua code to be embedded inside SASS. To get started:-

extern crate sass_alt;

use sass_alt::FunctionList;
use sass_alt::InputSyntax;
use sass_alt::SassOptions;

fn main()
{
	let sass_functions = vec![];
	let function_list = Rc::new(SassFunctionList(sass_functions));

	let importer_functions = vec![];
	let importer_list = Rc::new(SassImportersList(importer_functions));

	let header_functions = vec![];
	let header_list = Rc::new(SassImportersList(header_functions));

	let css = SassOptions::minified_css(InputSyntax::SCSS, &["/path/to/sass/includes"], &function_list, &importer_list, &header_list).compile_data(".hello { color: red }").unwrap();
}

Dependencies

~1.5MB
~30K SLoC