#css #sass #scss #web #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

#1277 in Web programming

Download history 3350/week @ 2024-08-17 3091/week @ 2024-08-24 3328/week @ 2024-08-31 3277/week @ 2024-09-07 3611/week @ 2024-09-14 3613/week @ 2024-09-21 3027/week @ 2024-09-28 3179/week @ 2024-10-05 4290/week @ 2024-10-12 3887/week @ 2024-10-19 4315/week @ 2024-10-26 4320/week @ 2024-11-02 5091/week @ 2024-11-09 5186/week @ 2024-11-16 6326/week @ 2024-11-23 4943/week @ 2024-11-30

22,045 downloads per month
Used in 62 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

~2.6–3.5MB
~60K SLoC