CSS Minifier

Compresses Cascading Style Sheets (CSS) code.

Input: TextResult: Text

Text input

Tool options

Examples

Compact a flex layout for a copied style tag

Input

.toolbar { display: flex; gap: 8px; align-items: center; }

Expected answer

.toolbar {display: flex;gap: 8px;align-items: center;}
Preserve comments
Off
Keep the attribution comment in a distributed theme

Input

/* Theme fragment: CC0 */
:root { --accent: #005fcc; }
a { color: var(--accent); }

Expected answer

/*Theme fragment: CC0 */:root {--accent: #005fcc;}a {color: var(--accent);}
Preserve comments
On
Remove a development note from a hover rule

Input

/* temporary debug border removed */
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px #ccc; }

Expected answer

 .card:hover {transform: translateY(-2px);box-shadow: 0 2px 4px #ccc;}
Preserve comments
Off
Compact an RGB color and a quoted font family

Input

h1 { color: rgb(12, 34, 56); font-family: "Times New Roman", serif; }

Expected answer

h1 {color: rgb(12, 34, 56);font-family: "Times New Roman", serif;}
Preserve comments
Off
Reduce a reduced-motion override

Input

@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

Expected answer

@media (prefers-reduced-motion: reduce) {.spinner {animation: none;}}
Preserve comments
Off

Parameters

ParameterDefault valueInput and choices
Preserve commentsfalseOn or off

Related tools

Browse code tidy tools