Gỡ bỏ tất cả chú thích
Nén siêu gọn
Giữ thụt đầu dòng trong @query {}
Loại bỏ các dấu chấm phẩy cuối cùng
Hình thức bố cục nội dòng
Xóa khoảng trống và thụt đầu dòng với: Một Tab 4 dấu cách
Chia đa bộ chọn (e.g: html,\nbody,\ntable {})
Khoảng trống: và ,
Inline bracket for single property
Gỡ bỏ các dấu chấm phẩy cuối cùng trong Code gốc
Ngắt dòng
/* ================= Supported layout/pattern: ================= */ /* -------- [1]. Nén CSS -------- */ /* a. Normal */ #foo{margin:0;padding:0} /* comment */ #foo:focus{outline:none} /* b. Gỡ bỏ tất cả chú thích */ #foo{margin:0;padding:0} #foo:focus{outline:none} /* c. Nén siêu gọn */ #foo{margin:0;padding:0}#foo:focus{outline:none} /* d. Giữ thụt đầu dòng trong `@query {}` */ #foo{margin:0;padding:0}#foo:focus{outline:none} #foo{margin:0;padding:0}#foo:focus{outline:none} @media screen and (max-width:400px){ #foo{margin:0;padding:0}#foo:focus{outline:none} #foo{margin:0;padding:0}#foo:focus{outline:none} } /* -------- [2]. Làm đẹp CSS code -------- */ /* a. Normal */ #foo { margin:0; padding:0; } #foo:focus { outline:none; } /* b. Replace double space indentation with a tab character or 4 spaces */ #tab-character { margin:0; padding:0; } #four-space { outline:none; } /* c. Chia đa bộ chọn */ #foo, #bar, .walaaa { margin:0; padding:0; } /* d. Space after `:` and `,` */ #foo { margin: 0 auto; background-image: linear-gradient(top, #333, #555); color: rgba(0, 0, 0, .4); } /* e. Inline bracket for single property */ #foo .bg { position:absolute; top:0; right:0; bottom:0; left:0; background:white url('img/bg-image.png') no-repeat 0 0; } #foo .bg-1 {background-position:0 0;} #foo .bg-2 {background-position:100% 0;} #foo .bg-3 {background-position:100% 100%;} #foo .bg-4 {background-position:0 100%;} /* f. Remove the last semicolon in single property */ #foo .bg { position:absolute; top:0; right:0; bottom:0; left:0; background:white url('img/bg-image.png') no-repeat 0 0; } #foo .bg-1 {background-position:0 0} #foo .bg-2 {background-position:100% 0} #foo .bg-3 {background-position:100% 100%} #foo .bg-4 {background-position:0 100%} /* g. Hình thức bố cục nội dòng */ #foo .bg { position:absolute; top:0; right:0; bottom:0; left:0; background:white url('img/bg-image.png') no-repeat 0 0; }