4 releases
0.12.4 | May 12, 2023 |
---|---|
0.12.3 | Feb 18, 2023 |
0.12.2 | Feb 1, 2023 |
0.12.1 | Jan 8, 2023 |
#857 in Web programming
6,111 downloads per month
Used in 9 crates
(2 directly)
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.
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
# use grass_compiler as grass;
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.1–2.8MB
~59K SLoC