| Crates.io | grimoire_css_transmutator |
| lib.rs | grimoire_css_transmutator |
| version | 0.9.0 |
| created_at | 2025-07-17 20:05:04.538544+00 |
| updated_at | 2025-07-17 20:05:04.538544+00 |
| description | A tool for seamlessly transforming CSS into Grimoire CSS spells. |
| homepage | https://github.com/persevie/grimoire_css_transmutator |
| repository | https://github.com/persevie/grimoire_css_transmutator |
| max_upload_size | |
| id | 1758048 |
| size | 72,857 |
A tool for seamlessly transforming standard CSS into Grimoire CSS spells.
grimoire_css_transmutator is available both as a CLI tool and as a Rust library crate. It helps you convert your CSS files or inline CSS content into a structured JSON format suitable for use with the Grimoire CSS system.
You need Rust installed.
cargo install --path .
grimoire_css_transmutator [OPTIONS] [INPUT]
-p, --paths Process comma-separated list of CSS file paths or glob patterns-c, --content Process CSS content provided as a string-o, --output Specify output file (default: ./grimoire/transmuted.json)-l, --with-oneliner Include oneliner property in output (default: disabled)-h, --help Display help messageConvert multiple CSS files:
grimoire_css_transmutator -p styles.css,components.css
Convert all CSS files in a directory:
grimoire_css_transmutator -p "src/**/*.css"
Convert inline CSS content:
grimoire_css_transmutator -c '.button { color: red; }' -l
Custom output file:
grimoire_css_transmutator -p '*.css' -o custom_output.json --with-oneliner
The output is a JSON file (or stdout) containing an array of objects, each representing a CSS class and its corresponding Grimoire CSS spells. Example:
{
"scrolls": [
{
"name": "button",
"spells": ["color=red"],
"oneliner": ".button { color: red; }"
}
]
}
You can use grimoire_css_transmutator both as a command-line tool and as a Rust library crate.
Add grimoire_css_transmutator_lib to your Cargo.toml dependencies and use it in your Rust code:
use grimoire_css_transmutator_lib::transmute_from_content;
let (duration, json) = transmute_from_content(".foo { color: blue; }", false).unwrap();
println!("{}", json);
MIT