Installation
PresetCSS ships as a single static binary. No Node, no npm, no runtime dependencies.
Rust required for cargo install
Install Rust from rustup.rs if you haven't already. Pre-built binaries will be available in a future release.
cargo install presetcss
# Verify the install
presetcss --version
Init a preset
Run presetcss init in your project root to generate a commented
preset.toml with sensible defaults.
presetcss init
# Or specify a path
presetcss init --output ./config/preset.toml
Build CSS
presetcss build
# Rebuild on file change
presetcss watch
Colors
Each key in [colors] generates three utility classes.
primary = "#0284c7"
muted = "#64748b"
Generates:
Name collisions
Color names that clash with static utilities (like block or flex)
will trigger a build error. Use presetcss validate to check before building.
Variants
Variants are opt-in per token group. Nothing is generated unless you ask for it.
# Generate hover: and focus: classes for color tokens only
colors = ["hover", "focus"]
static = ["responsive"] # enables breakpoint:flex etc.
spacing = [] # no spacing variants
Variant explosion
Enabling all variants for all groups can multiply output size by 10x or more.
Combine variants with content scanning to avoid shipping unused rules.