Raffia
Raffia is a parser which can parse CSS, SCSS, Sass (indented syntax) and Less. However, it won't compile SCSS, Sass or Less to CSS.
๐งช Playground
There is an online playground for inspecting AST. Visit: https://raffia-play.vercel.app/.
๐ญ Example
use ;
let mut parser = new;
let ast = parser..unwrap;
println!;
You can find more examples in the examples directory.
For detailed usage, check out docs.rs.
๐๏ธ Current Status
- CSS: Almost completed.
- SCSS/Sass: Mostly implemented. Some features are still in progress.
- Less: Only a few features are implemented.
โ Benchmark
You can run compare performance with other parsers with benchmark.
First, you need to setup Rust and clone this repository. You also need to install cargo-criterion by running cargo install cargo-criterion.
Then, copy some CSS files to bench_data directory. You need to create that directory by yourself.
Now you can run benchmark by running cargo criterion.
โจ Credit
Tests come from:
๐ License
MIT License
Copyright (c) 2022-present Pig Fang