2020-01-19 22:58:25 -05:00
|
|
|
# grass
|
|
|
|
|
2020-04-19 16:38:42 -04:00
|
|
|
This crate aims to provide a high level interface for compiling SASS into
|
|
|
|
plain CSS. It offers a very limited API, currently exposing only 2 structs.
|
2020-01-20 12:42:06 -05:00
|
|
|
|
2020-04-21 04:59:03 -04:00
|
|
|
In addition to a library, also included is a binary that is intended to act as an invisible
|
2020-04-19 16:38:42 -04:00
|
|
|
replacement to the sass commandline executable.
|
|
|
|
|
|
|
|
This crate aims to achieve complete feature parity with the dart-sass reference
|
|
|
|
implementation. A deviation from the dart-sass implementation can be considered
|
|
|
|
a bug except for in the following situations:
|
2020-04-24 18:38:52 -04:00
|
|
|
|
|
|
|
- Error messages
|
|
|
|
- Error spans
|
|
|
|
- Certain aspects of the indented syntax
|
|
|
|
- Potentially others in the future
|
2020-04-19 16:38:42 -04:00
|
|
|
|
2020-04-20 12:15:07 -04:00
|
|
|
[Documentation](https://docs.rs/grass/)
|
2020-04-19 16:38:42 -04:00
|
|
|
[crates.io](https://crates.io/crates/grass)
|
2020-01-20 12:42:06 -05:00
|
|
|
|
2020-04-24 18:43:52 -04:00
|
|
|
## Web Assembly
|
2020-04-24 18:38:52 -04:00
|
|
|
|
|
|
|
`grass` experimentally releases a
|
|
|
|
[WASM version of the library to npm](https://www.npmjs.com/package/@connorskees/grass),
|
|
|
|
compiled using wasm-bindgen. To use `grass` in your JavaScript projects, just add
|
2020-05-11 12:59:31 -04:00
|
|
|
`"@connorskees/grass": "^0.8.2"` to your package.json. Better documentation
|
2020-04-24 18:38:52 -04:00
|
|
|
for this version will be provided when the library becomes more stable.
|
|
|
|
|
|
|
|
## Status
|
|
|
|
|
2020-03-22 15:44:47 -04:00
|
|
|
The large features remaining are
|
2020-04-24 18:38:52 -04:00
|
|
|
|
2020-03-22 15:44:47 -04:00
|
|
|
```
|
2020-04-05 12:55:39 -04:00
|
|
|
all builtin selector functions (274 tests)
|
2020-04-21 04:59:03 -04:00
|
|
|
builtin functions content-exists, min, max
|
2020-04-05 12:55:39 -04:00
|
|
|
@extend (~600 tests)
|
|
|
|
indented syntax (27 tests)
|
2020-04-26 01:45:30 -04:00
|
|
|
css imports
|
2020-04-05 12:55:39 -04:00
|
|
|
@use and module system (~1200 tests)
|
|
|
|
@forward (~400 tests)
|
2020-04-05 17:42:08 -04:00
|
|
|
@keyframes (~30 tests)
|
2020-04-12 22:03:40 -04:00
|
|
|
@supports (~128 tests)
|
2020-04-26 01:45:30 -04:00
|
|
|
@each inside @function
|
2020-03-22 15:44:47 -04:00
|
|
|
```
|
|
|
|
|
2020-04-24 18:38:52 -04:00
|
|
|
## Testing
|
|
|
|
|
|
|
|
As much as possible this library attempts to follow the same [philosophy for testing as
|
|
|
|
`rust-analyzer`](https://internals.rust-lang.org/t/experience-report-contributing-to-rust-lang-rust/12012/17).
|
|
|
|
Namely, all one should have to do is run `cargo test` to run all its tests.
|
|
|
|
This library maintains a test suite distinct from the `sass-spec`, though it
|
|
|
|
does include some spec tests verbatim. This has the benefit of allowing tests
|
|
|
|
to be run without ruby as well as allowing the tests more granular than they
|
|
|
|
are in the official spec.
|
|
|
|
|
|
|
|
Having said that, to run the official test suite,
|
2020-04-19 16:38:42 -04:00
|
|
|
|
|
|
|
```bash
|
2020-04-28 15:08:01 -04:00
|
|
|
git clone https://github.com/connorskees/grass --recursive
|
2020-04-19 16:38:42 -04:00
|
|
|
cd grass
|
|
|
|
cargo b --release
|
|
|
|
./sass-spec/sass-spec.rb -c './target/release/grass'
|
|
|
|
```
|
|
|
|
|
2020-04-24 18:38:52 -04:00
|
|
|
These numbers come from a default run of the sass specification as shown above.
|
|
|
|
|
2020-05-05 19:01:40 -04:00
|
|
|
```
|
|
|
|
2020-05-01
|
|
|
|
PASSING: 2193
|
|
|
|
FAILING: 2900
|
|
|
|
TOTAL: 5093
|
|
|
|
```
|
|
|
|
|
2020-04-21 04:59:03 -04:00
|
|
|
```
|
|
|
|
2020-04-21
|
|
|
|
PASSING: 2150
|
|
|
|
FAILING: 2943
|
|
|
|
TOTAL: 5093
|
|
|
|
```
|
|
|
|
|
2020-04-04 12:59:05 -04:00
|
|
|
```
|
2020-04-07 00:10:18 -04:00
|
|
|
2020-04-07
|
|
|
|
PASSING: 2031
|
|
|
|
FAILING: 3062
|
2020-04-04 12:59:05 -04:00
|
|
|
TOTAL: 5093
|
|
|
|
```
|
|
|
|
|
2020-04-01 17:53:47 -04:00
|
|
|
```
|
|
|
|
2020-04-01
|
|
|
|
PASSING: 1711
|
|
|
|
FAILING: 3382
|
|
|
|
TOTAL: 5093
|
|
|
|
```
|
2020-02-09 22:48:55 -05:00
|
|
|
|
2020-03-30 03:18:27 -04:00
|
|
|
```
|
|
|
|
2020-03-30
|
2020-03-30 16:53:27 -04:00
|
|
|
PASSING: 1685
|
|
|
|
FAILING: 3408
|
2020-03-30 03:18:27 -04:00
|
|
|
TOTAL: 5093
|
|
|
|
```
|
|
|
|
|
2020-03-24 10:53:21 -04:00
|
|
|
```
|
|
|
|
2020-03-23
|
|
|
|
PASSING: 1547
|
|
|
|
FAILING: 3546
|
|
|
|
TOTAL: 5093
|
|
|
|
```
|
|
|
|
|
2020-03-20 21:00:27 -04:00
|
|
|
```
|
2020-03-22 15:44:47 -04:00
|
|
|
2020-03-22
|
|
|
|
PASSING: 1442
|
|
|
|
FAILING: 3651
|
2020-03-20 21:00:27 -04:00
|
|
|
TOTAL: 5093
|
2020-03-20 21:10:58 -04:00
|
|
|
```
|
|
|
|
|
2020-02-24 20:16:19 -05:00
|
|
|
```
|
|
|
|
2020-02-24
|
|
|
|
PASSING: 1192
|
|
|
|
FAILING: 3901
|
|
|
|
TOTAL: 5093
|
|
|
|
```
|
|
|
|
|
2020-02-15 10:06:26 -05:00
|
|
|
```
|
2020-02-18 07:09:12 -05:00
|
|
|
2020-02-17
|
|
|
|
PASSING: 1115
|
|
|
|
FAILING: 3978
|
2020-02-15 10:06:26 -05:00
|
|
|
TOTAL: 5093
|
|
|
|
```
|
|
|
|
|
2020-02-09 22:48:55 -05:00
|
|
|
```
|
|
|
|
2020-02-10
|
|
|
|
PASSING: 475
|
|
|
|
FAILING: 4618
|
|
|
|
TOTAL: 5093
|
|
|
|
```
|
|
|
|
|
2020-02-03 08:49:47 -05:00
|
|
|
```
|
|
|
|
2020-02-03
|
|
|
|
PASSING: 242
|
|
|
|
FAILING: 4851
|
2020-01-27 16:57:12 -05:00
|
|
|
TOTAL: 5093
|
2020-02-03 08:49:47 -05:00
|
|
|
```
|
2020-01-27 16:57:12 -05:00
|
|
|
|
2020-02-03 08:49:47 -05:00
|
|
|
```
|
|
|
|
2020-01-27
|
|
|
|
PASSING: 186
|
|
|
|
FAILING: 4907
|
|
|
|
TOTAL: 5093
|
|
|
|
```
|
2020-01-19 22:58:25 -05:00
|
|
|
|
2020-02-03 08:49:47 -05:00
|
|
|
```
|
|
|
|
2020-01-20
|
|
|
|
PASSING: 143
|
|
|
|
FAILING: 4950
|
|
|
|
TOTAL: 5093
|
|
|
|
```
|