Sass Rocket Fairing
sass-rocket-fairing is a Fairing/middleware for rocket.rs facilitating sass compilation. It compiles your sass files on change automagically ✨
Installing
Add the following to your Cargo.toml file
= "0.1"
OR using git
= { = "0.1", ="https://github.com/SyedAhkam/sass-rocket-fairing.git"}
Usage
extern crate rocket;
use SassFairing;
Configuration
SassFairing takes advantage of rocket's advanced configuration system. There are two ways to configure it.
- Using Rocket.toml (recommended)
Add a Rocket.toml file in root directory of your crate and add the following to it:
[]
= "static/sass"
= "static/css
- Using enviroment variables
Set the following environment variables:
- ROCKET_SASS_DIR
- ROCKET_CSS_DIR
Where
-
sass_diris the folder where your sass files are to be located. -
css diris where your built css files are to be located.
Thanks
I've stolen a big chunk of code from rocket_dyn_templates and adapted it to my needs.
Contributing
Feel free to send me a pull request! My code might be a little iffy but that's because I'm new to the rust ecosystem.
License
Licensed under the most permissive license, MIT.