#css #sass #web #scss #internal

grass_compiler

Internal implementation of the grass compiler

8 releases

0.13.4 Aug 4, 2024
0.13.3 May 19, 2024
0.13.2 Feb 7, 2024
0.13.0 Jul 9, 2023
0.12.1 Jan 8, 2023

#1461 in Web programming

Download history 3508/week @ 2024-07-12 4146/week @ 2024-07-19 3669/week @ 2024-07-26 3746/week @ 2024-08-02 3333/week @ 2024-08-09 3356/week @ 2024-08-16 3077/week @ 2024-08-23 3345/week @ 2024-08-30 3331/week @ 2024-09-06 3603/week @ 2024-09-13 3571/week @ 2024-09-20 3072/week @ 2024-09-27 3028/week @ 2024-10-04 4243/week @ 2024-10-11 3985/week @ 2024-10-18 3289/week @ 2024-10-25

14,926 downloads per month
Used in 44 crates (3 directly)

MIT license

1MB
23K SLoC

grass_compiler

This crate exposes the internals of the main package, grass. For most users, the preferred crate should be grass, as it is more stable and has a simpler API.

This crate will see frequent breaking changes.

Documentation
crates.io


lib.rs:

This crate provides functionality for compiling Sass to CSS.

This crate targets compatibility with the reference implementation in Dart. If upgrading from the now deprecated libsass, one may have to modify their stylesheets. These changes will not differ from those necessary to upgrade to dart-sass, and in general such changes should be quite rare.

This crate is capable of compiling Bootstrap 4 and 5, bulma and bulma-scss, Bourbon, as well as most other large Sass libraries with complete accuracy. For the vast majority of use cases there should be no perceptible differences from the reference implementation.

Use as library

fn main() -> Result<(), Box<grass::Error>> {
let css = grass::from_string(
"a { b { color: &; } }".to_owned(),
&grass::Options::default().style(grass::OutputStyle::Compressed)
)?;
assert_eq!(css, "a b{color:a b}");
Ok(())
}

Use as binary

cargo install grass
grass input.scss

Dependencies

~3.5MB
~63K SLoC