壓縮 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)