Optimisation
When CSS is heading for production, it takes an extra step through cssnano (http://cssnano.co/). It's a fantastic and modular CSS minifier by the extraordinarily talented Ben Briggs. Highly recommended.
Besides the more obvious minification step that cssnano provides, there are a number of micro-optimisations you can perform on your CSS just by incorporating plugins from the PostCSS eco-system. For example, by consistently ordering your CSS declarations, Gzip can compress the style sheet more effectively. That's not a job I want to do manually but the postcss-sorting (https://github.com/hudochenkov/postcss-sorting) plugin can do it for free. Here's comparison of Gzip file sizes using the various declaration sorting configurations. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access