PresetCSS
v0.1.0 - written in Rust, zero npm

CSS utilities,
without the config hell.

One flat TOML file in.  One optimized CSS file out. No JavaScript. No plugins. No extend merge confusion.

# 1. create a preset
presetcss init

# 2. build CSS
presetcss build

# 3. done - link dist/preset.css in your HTML

Same result. Less ceremony.

Both snippets produce bg-primary, text-primary, border-primary.

✗ tailwind.config.js

module.exports = {
theme: {
extend: { // or override? 🤔
colors: {
primary: {
DEFAULT: '#3b82f6',
dark: '#1d4ed8',
},
},
},
},
plugins: [
plugin(function({ addUtilities }) {
addUtilities({ '.btn': { ... } })
}),
],
}

✓ preset.toml

[colors]
primary = "#3b82f6"
primary-dark = "#1d4ed8"

[breakpoints]
tablet = "768px"
desktop = "1024px"

[variants]
colors = ["hover", "focus"]

[utilities]
btn = "padding: 0.5rem 1rem; ..."

Why PresetCSS?

Built around one promise: what you write is exactly what gets generated.

📄

One flat file

[colors] replaces the default palette. [extend.colors] adds to it. Two spellings, two meanings, zero ambiguity.

Rust-speed binary

A single static binary - no Node, no npm install. Drop it in any project: Rust, Go, Python, PHP. Works offline.

🎯

Exact tree-shaking

Set content = ["src/**/*.html"] and only used classes are emitted - with near-miss warnings instead of silent drops.

🔍

explain command

presetcss explain bg-primary shows the exact CSS rule and which line in preset.toml produced it.

🧩

Opt-in variants

hover:, focus:, and breakpoints are declared per group. Nothing is generated unless you asked for it.

🎨

Token export

presetcss export --format json|js|css-vars - one source of truth for design and code.

Get started in 30 seconds

Install the binary, init a preset, build CSS. That's it.

# Install
cargo install presetcss

# Write a commented default preset.toml
presetcss init

# Edit preset.toml, then generate CSS
presetcss build

# Rebuild on every change
presetcss watch

Other useful commands

presetcss validate Check the preset for typos and collisions - no output written
presetcss explain bg-primary Show the CSS rule + preset line for any class
presetcss export --format json Export design tokens (also: js, css-vars)
presetcss help theme List all token keys generated by the current preset