Dev UtilitiesLesson 137Free preview
CSS Minifier
This lesson is part of Web Developer Tools · All levels
Summary
The CSS minifier removes unnecessary spaces, comments, and characters from the style sheet to make it smaller. The resulting CSS remains valid and can be directly used by the browser. Minification reduces the size of the transfer, not encrypting or hiding the code. Save the readable source version and test the display after the minification process.
Key points
- Minification reduces file size by removing whitespace and comments
- The name of the class and CSS rules are not changed by simple minifiers
- Always save the source file for development
- Cases like calc() require spaces to remain valid
- View testing after the CSS is minified
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.