I wonder how it’s possible to optimize CSS file for faster loading, at the moment my CSS file is arround 2400 lines and it size is 54kb. None of the graphic elements is bigger then 4kb, so I believe CSS is reasson my website is rendering/loading slow.
That’s just main CSS, on some pages, I’m loading additional CSS files.
That’s a lot of CSS. While a CSS “minify” tool is a good idea, you may want to take a manual pass over the file and look for rules that can be combined. For instance:
can be reduced to:
And even further to:
Similarly, borders can be reduced:
This can be expressed as:
background, padding, and fonts are some of the other rules that can be written such that they are much shorter and more efficient. Here’s a good article on CSS Shortcuts.
The CSS minifiers are useful tools, but I’m not sure they are able to rearrange your code into the shortcut format.