CSS beautify / minify
css_formatBeautify or minify CSS from text or a file, with optional comment removal while preserving strings, url(...), escapes, and calc() spacing.
Instructions
Beautify CSS (one declaration per line, one selector per line, blank line between top-level rules, nested @media blocks) or minify it. Strings, url(...) and escapes are kept intact; calc() spacing is preserved. Optional comment removal (/*! … */ kept). Give "text" or a file "path". Web version: https://s3eidat.github.io/html-css-format/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | "beautify" (default) or "minify". | beautify |
| path | No | Or: a path to a CSS file (UTF-8; use this for big inputs). | |
| text | No | The CSS as inline text. | |
| indent | No | Indentation: 2, 4, "tab" (or any number of spaces 0-8). | 2 |
| output | No | Optional: also write the result to this file path (or folder ending in "/"). The result text is then left out of the reply. Results over 1,000,000 characters are always written to a file. | |
| removeComments | No | Drop comments (/*! … */ license comments are kept). |