Wednesday 27 August 2014

Quick Tip - Minification In Linux

Often, when building and testing a website, you may be working with two or more style sheets. However, before uploading your site it's best practise to merge your css files in order to reduce any lag between request and response. There are several tools available to achieve this but Linux has its own command line tool, cssmin.

To install cssmin, open a terminal and:

sudo apt-get install cssmin

Enter your password and allow the application to install. To merge your style sheets:

cat file1.css file2.css file3.css | cssmin > output.min.css

Where filen.css are the source files and output.min.css is the output file. Obviously, you will need to link your html files to the new style sheet.

Sources & Resources:

No comments:

Post a Comment