Crate rsass [−] [src]
Sass reimplemented in rust with nom.
The "r" in the name might stand for the Rust programming language, or for my name Rasmus.
Example
use rsass::{OutputStyle, compile_scss_file}; let file = "tests/basic/14_imports/a.scss".as_ref(); let css = compile_scss_file(file, OutputStyle::Compressed).unwrap(); assert_eq!(css, b"div span{moo:goo}\n")
Sass language and implemetation status
The sass language is defined in its reference doc. This implementation is incomplete but getting there, if slowly.
Progress: of 3294 tests passed (or 899 of 6049 when claiming to be libsass).
If you want a working rust library for sass right now, you will probably be better of with sass-rs which is a rust wrapper around libsass. Another alternative is sassers which is another early stage pure rust implementation. That said, this implementation has reached a version where I find it usable for my personal projects, and the number of working tests are improving.
Structs
FileContext |
A file context specifies where to find files to load. |
Enums
Error | |
OutputStyle |
Selected target format. Only formats that are variants of this type are supported by rsass. |
SassItem |
Every sass file is a sequence of sass items. Scoping items contains further sequences of items. |
Functions
compile_scss |
Parse scss data and write css in the given style. |
compile_scss_file |
Parse a file of scss data and write css in the given style. |
parse_scss_file |
Parse a scss file. |