turf 🌱

turf allows you to build SCSS to CSS during compile time and inject those styles into your binary.

Crates.io Docs.rs Build Status MIT licensed

Features

turf will:

Usage

For a complete runnable example project, you can check out the leptos-example.

1. Create SCSS styles for your application.

```scss // file at scss/file/path.scss

:root { color: red;

.SomeClass {
    color: blue;
}

} ```

By following the link here you can gain a deeper understanding of how stylist processes selectors. By understanding these rules, you can effectively utilize the dynamic class names generated.

2. Use the style_sheet macro to include the resulting CSS in your code

rust turf::style_sheet!("scss/file/path.scss");

The macro from the above example will expand to the following code:

rust static CLASS_NAME: &'static str = "<class_name>"; static STYLE_SHEET: &'static str = "<style_sheet>";

3. Configuration

The configuration for turf can be specified in the Cargo.toml file using the [package.metadata.turf] key. This allows you to conveniently manage your SCSS compilation settings within your project's manifest.

The following configuration options are available:

Example configuration:

toml [package.metadata.turf] load_paths = ["path/to/scss/files", "another/path"] output_style = "compressed"

Contributions

Contributions to turf are always welcome! Whether you have ideas for new features or improvements, don't hesitate to open an issue or submit a pull request. Let's collaborate and make turf even better together. 🤝

License

turf is licensed under the MIT license. For more details, please refer to the LICENSE file. 📄