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§
- Callees
Sass Compiler Iterator - An iterator over Sass_Callee_Entry callees.
- Imports
Sass Compiler Iterator - An iterator over Sass_Import_Entry imports.
- Sass
Compiler - A Wrapper around the Sass_Compiler object to make it easier to use correctly.
- Sass
Context - Wraps a SASS data or file context and holds a list of function used by that context.
- Sass
Function List - 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.
- Sass
Import Entry - A memory-safe wrapper around a Sass_Import_Entry which ensures it gets dropped as required.
- Sass
Importer Error - An error returned from an importer.
- Sass
Importer List - 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.
- Sass
Options - A set of options for creating SASS contexts.
Enums§
- Input
Syntax - 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 toSCSS
. - Output
Style - SASS output style
- Sass
Compile Error - A compilation error.
- Sass
Function Signature - Represents a Sass Function signature.
- Sass
Import - Represents the three different kinds of SassImport.
Traits§
- Data
OrFile Sass Context MutPointer - An extension type for the *mut Sass_Data_Context and *mut Sass_File_Context class to make their methods Object-Orientated and interchangeable.
- Sass
Function - A type to model SASS functions.
- Sass
Importer - 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§
- Sass
Function Trait Object - A type to make it easier to work with, and remember, that SassFunctions are boxed trait objects.
- Sass
Importer Trait Object - A type to make it easier to work with, and remember, that SassFunctions are boxed trait objects.