压缩 CSS

去掉源代码中多余的排版空白,输出仍是文本而非压缩文件。

输入: 文本结果: 文本

文本输入

工具选项

案例

Compact a flex layout for a copied style tag

输入

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

Expected answer

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

输入

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

Expected answer

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

输入

/* 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;}
保留注释
Off
Compact an RGB color and a quoted font family

输入

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;}
保留注释
Off
Reduce a reduced-motion override

输入

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

Expected answer

@media (prefers-reduced-motion: reduce) {.spinner {animation: none;}}
保留注释
Off

参数

参数默认值输入与选项
保留注释false开启或关闭

相关工具

代码整理

操作参考

查看原始技术文档 (English)