# CSS formatter

Pretty-print minified or messy CSS with one declaration per line and nested @media blocks indented.

- Endpoint: `POST https://setget.net/v1/tools/css-format` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `css-format`
- Page: https://setget.net/tools/css-format

## Inputs

- `text` (required, string): The CSS to format.
- `indent` (optional, integer, default `2`, range 1..8): Spaces per indentation level.

## Example

```json
{"input":{"text":"a{color:red;margin:0 auto}@media (min-width:600px){a,b{color:blue}}"}}
```

Result:

```json
{"text":"a {\n  color: red;\n  margin: 0 auto;\n}\n\n@media (min-width: 600px) {\n  a, b {\n    color: blue;\n  }\n}"}
```

**Does formatting change what the CSS does?** No. Only white space changes, and a semicolon is added after the last declaration of each block.

**Does it handle nesting?** Yes. @media, @supports, @layer, @keyframes and nested rules are indented one level per block.
