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 3340 tests passed (or 1571 of 6095 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.
Modules
css | |
sass |
Structs
FileContext |
A file context specifies where to find files to load. |
GlobalScope |
A |
SassFunction |
A function that can be called from a sass value. |
Enums
Error |
Most functions in rsass that returns a Result uses this Error type. |
Item |
Every sass file is a sequence of sass items. Scoping items contains further sequences of items. |
ListSeparator |
The difference between a comma-separated and a whitespace-separated list. |
OutputStyle |
Selected target format. Only formats that are variants of this type are supported by rsass. |
Quotes |
A literal value can be double-quoted, single-quoted or not quoted. |
Unit |
Units in css. |
Traits
Scope |
Variables, functions and mixins are defined in a |
Functions
compile_scss |
Parse scss data from a buffer and write css in the given style. |
compile_scss_file |
Parse a file of scss data and write css in the given style. |
compile_value |
Parse scss data from a buffer and write css in the given style. |
parse_scss_data |
Parse scss data from a buffer. |
parse_scss_file |
Parse a scss file. |
parse_value_data |
Parse a scss value. |
Type Definitions
Rational |
Alias for a |