Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2800

css-minification

Skill này làm gì

Skill này kiểm tra xem stylesheet có được thu nhỏ khi chạy thật hay không. Skill dành cho lập trình viên và chủ website muốn trang tải nhanh hơn mà kết quả hiển thị vẫn giữ nguyên.

Khi nào nên dùng

  • ✓Khi tệp CSS chạy thật vẫn dễ đọc và đầy khoảng trắng.
  • ✓Khi công cụ build của bạn chưa được thiết lập để thu nhỏ.
  • ✓Khi bạn muốn kết hợp thu nhỏ với nén để tệp còn nhỏ hơn nữa.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/css-minification/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/css-minification/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy đảm bảo bản build chạy thật của tôi thu nhỏ mọi tệp CSS và cho tôi biết tệp nhỏ đi bao nhiêu.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent thiết lập thu nhỏ trong công cụ build, dùng các công cụ như cssnano, lightningcss hoặc tùy chọn có sẵn của framework, rồi xác nhận đầu ra nhỏ hơn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Minify all CSS files

Unminified CSS wastes bandwidth with whitespace, comments, and verbose syntax—minification delivers the same styles in significantly fewer bytes.

Quick Reference

  • Enable minification in build tool (Vite, webpack, etc.)
  • Use cssnano or lightningcss for PostCSS pipelines
  • Typical reduction: 20-40% file size savings
  • Combine with Gzip/Brotli for maximum compression

Check

Verify that all CSS files are minified in production to reduce file size, eliminate whitespace, and improve page load performance.

Fix

Set up CSS minification in your build process using tools like cssnano, CleanCSS, or built-in framework minification to compress CSS files.

Explain

Explain how CSS minification improves website performance by reducing file sizes, decreasing bandwidth usage, and speeding up page load times.

Code Review

Review stylesheets, component styles, and responsive states related to Minify all CSS files. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/css/css-minification

Câu hỏi thường gặp

CSS có thể nhỏ đi bao nhiêu?

Skill đưa khoảng phổ biến từ 20 đến 40 phần trăm.

Thu nhỏ có làm thay đổi giao diện trang không?

Skill mô tả đây là cùng các style nhưng dùng ít byte hơn.

Tôi có nên dùng thêm nén không?

Có. Skill gợi ý kết hợp thu nhỏ với Gzip hoặc Brotli.

Chi tiết

Mô tả gốc của tác giả

Use when reviewing stylesheets, component styles, and responsive behavior related to Minify all CSS files. Check the rendered layout across breakpoints and interaction states before proposing a fix.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2800
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự