peasy-css
Async Rust client for the PeasyCSS API -- minify, beautify, and convert CSS units with tools for gradient generation, shadow creation, flexbox layouts, and grid systems. Built with reqwest, serde, and tokio.
Built from PeasyCSS, a comprehensive CSS toolkit offering free online tools for minifying, formatting, analyzing, and generating CSS code with detailed property guides, layout references, and a glossary covering modern CSS specifications including Grid, Flexbox, Custom Properties, and Container Queries.
Try the interactive tools at peasycss.com -- CSS Minify, CSS Beautify, CSS Unit Converter, and more.
Table of Contents
- Install
- Quick Start
- What You Can Do
- API Client
- Learn More About CSS Tools
- Also Available
- Peasy Developer Tools
- License
Install
[]
= "0.2.0"
= { = "1", = ["full"] }
Or via cargo:
Quick Start
use Client;
async
What You Can Do
CSS Optimization Tools
CSS optimization is essential for web performance. Minified CSS reduces file sizes by removing whitespace, comments, and redundant declarations, while beautified CSS restores readability for debugging. The PeasyCSS API provides programmatic access to these transformations alongside unit conversion tools for responsive design workflows.
| Tool | Description | Use Case |
|---|---|---|
| CSS Minify | Remove whitespace and comments from CSS | Production builds, CI/CD pipelines |
| CSS Beautify | Format and indent CSS for readability | Code review, debugging |
| CSS Unit Converter | Convert between px, rem, em, vw, vh | Responsive design systems |
use Client;
async
Learn more: CSS Minify Tool · CSS Beautify Tool · How to Minify CSS for Production
Browse CSS Reference Content
Modern CSS has evolved far beyond simple selectors and properties. Concepts like CSS Grid, Flexbox, Custom Properties (CSS variables), specificity rules, and the cascade determine how styles are applied. The PeasyCSS glossary provides clear definitions and practical examples for these foundational concepts, while guides offer in-depth tutorials on layout techniques and optimization strategies.
| Glossary Term | Description |
|---|---|
| Flexbox | One-dimensional layout model for distributing space along a row or column |
| Grid | Two-dimensional layout system for rows and columns simultaneously |
| Specificity | Algorithm that determines which CSS rule takes precedence |
| Custom Property | CSS variables defined with -- prefix, enabling dynamic theming |
| Minification | Process of removing unnecessary characters from CSS without changing functionality |
// Browse CSS glossary terms programmatically
let glossary = client.list_glossary.await?;
for term in &glossary.results
// Read in-depth CSS guides on layout and optimization
let guides = client.list_guides.await?;
for guide in &guides.results
Learn more: Flexbox Glossary · Grid Glossary · CSS Grid vs Flexbox Guide
Search and Discovery
The unified search endpoint queries across all CSS tools, glossary terms, guides, and file formats simultaneously. This is useful for building IDE integrations, documentation search, or CLI tools that need to surface relevant CSS content based on user queries.
// Search across all CSS tools, glossary, and guides
let results = client.search.await?;
println!; // Cross-content CSS search results
Learn more: Specificity Glossary · Custom Property Glossary · All CSS Guides
API Client
The client wraps the PeasyCSS REST API with strongly-typed Rust structs using serde deserialization.
use Client;
async
Available Methods
| Method | Description |
|---|---|
list_tools(&opts) |
List tools (paginated, filterable) |
get_tool(slug) |
Get tool by slug |
list_categories(&opts) |
List tool categories |
list_formats(&opts) |
List file formats |
get_format(slug) |
Get format by slug |
list_conversions(&opts) |
List format conversions |
list_glossary(&opts) |
List glossary terms |
get_glossary_term(slug) |
Get glossary term |
list_guides(&opts) |
List guides |
get_guide(slug) |
Get guide by slug |
list_use_cases(&opts) |
List use cases |
search(query, limit) |
Search across all content |
list_sites() |
List Peasy sites |
openapi_spec() |
Get OpenAPI specification |
Full API documentation at peasycss.com/developers/. OpenAPI 3.1.0 spec: peasycss.com/api/openapi.json.
Learn More About CSS Tools
- Tools: CSS Minify · CSS Beautify · CSS Unit Converter · All Tools
- Guides: CSS Grid vs Flexbox · How to Minify CSS for Production · All Guides
- Glossary: Flexbox · Grid · Minification · Specificity · Custom Property · All Terms
- Formats: All Formats
- API: REST API Docs · OpenAPI Spec
Also Available
| Language | Package | Install |
|---|---|---|
| Python | peasy-css | pip install "peasy-css[all]" |
| TypeScript | peasy-css | npm install peasy-css |
| Go | peasy-css-go | go get github.com/peasytools/peasy-css-go |
| Ruby | peasy-css | gem install peasy-css |
Peasy Developer Tools
Part of the Peasy Tools open-source developer ecosystem.
| Package | PyPI | npm | crates.io | Description |
|---|---|---|---|---|
| peasy-pdf | PyPI | npm | crate | PDF merge, split, rotate, compress -- peasypdf.com |
| peasy-image | PyPI | npm | crate | Image resize, crop, convert, compress -- peasyimage.com |
| peasy-audio | PyPI | npm | crate | Audio trim, merge, convert, normalize -- peasyaudio.com |
| peasy-video | PyPI | npm | crate | Video trim, resize, thumbnails, GIF -- peasyvideo.com |
| peasy-css | PyPI | npm | crate | CSS minify, format, analyze -- peasycss.com |
| peasy-compress | PyPI | npm | crate | ZIP, TAR, gzip compression -- peasytools.com |
| peasy-document | PyPI | npm | crate | Markdown, HTML, CSV, JSON conversion -- peasyformats.com |
| peasytext | PyPI | npm | crate | Text case conversion, slugify, word count -- peasytext.com |
License
MIT