Crate sass_alt

Source
Expand description

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();
}

Re-exports§

pub extern crate sass_sys;

Modules§

values
Wrappers for Sass_Value

Structs§

CalleesSassCompilerIterator
An iterator over Sass_Callee_Entry callees.
ImportsSassCompilerIterator
An iterator over Sass_Import_Entry imports.
SassCompiler
A Wrapper around the Sass_Compiler object to make it easier to use correctly.
SassContext
Wraps a SASS data or file context and holds a list of function used by that context.
SassFunctionList
A wrapper type that holds a list of SASS functions and their Rust representations so that Rust function lifetimes exceed references to SASS functions held by the libsass C object Sass_Function_List.
SassImportEntry
A memory-safe wrapper around a Sass_Import_Entry which ensures it gets dropped as required.
SassImporterError
An error returned from an importer.
SassImporterList
A wrapper type that holds a list of SASS importers and their Rust representations so that Rust importer lifetimes exceed references to SASS importer held by the libsass C object Sass_Importer_List.
SassOptions
A set of options for creating SASS contexts.

Enums§

InputSyntax
A wrapper type to make it much clearer which SASS syntax we expect data to be in. Replaces the use of a boolean to model data that is SASS as opposed to SCSS.
OutputStyle
SASS output style
SassCompileError
A compilation error.
SassFunctionSignature
Represents a Sass Function signature.
SassImport
Represents the three different kinds of SassImport.

Traits§

DataOrFileSassContextMutPointer
An extension type for the *mut Sass_Data_Context and *mut Sass_File_Context class to make their methods Object-Orientated and interchangeable.
SassFunction
A type to model SASS functions.
SassImporter
A type to model SASS importers. Include it by using use ::sass_alt::Sass_Import_Entry_Ext;.
Sass_Callee_Entry_Ext
An extension type for the Sass_Callee_Entry_Ext class to make its methods Object-Orientated.
Sass_Compiler_Ext
An extension type for the *mut Sass_Compiler class to make its methods Object-Orientated.
Sass_Env_Frame_Ext
An extension type for the Sass_Env_Frame_Ext class to make its methods Object-Orientated.
Sass_Import_Entry_Ext
An extension type for the *mut Sass_Import_Entry class to make its methods Object-Orientated.

Type Aliases§

SassFunctionTraitObject
A type to make it easier to work with, and remember, that SassFunctions are boxed trait objects.
SassImporterTraitObject
A type to make it easier to work with, and remember, that SassFunctions are boxed trait objects.