Grimoire CSS Transmutator
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.
Features
- Batch conversion: Process multiple CSS files or patterns at once.
- Inline content: Convert CSS provided as a string.
- Flexible output: Save results to a file or print to stdout.
- Oneliner support: Optionally include a one-line representation for each class.
Installation
You need Rust installed.
Usage
Options
-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
Includeoneliner
property in output (default: disabled)-h
,--help
Display help message
Examples
Convert multiple CSS files:
Convert all CSS files in a directory:
Convert inline CSS content:
Custom output file:
Output
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:
Library and CLI Usage
You can use grimoire_css_transmutator
both as a command-line tool and as a Rust library crate.
As a library
Add grimoire_css_transmutator_lib
to your Cargo.toml
dependencies and use it in your Rust code:
use transmute_from_content;
let = transmute_from_content.unwrap;
println!;
License
MIT